Download presentation
Presentation is loading. Please wait.
1
Development of The Menu System
KwangWoo Choi Department of Physics Kangwon National University Steps for the toolbar 1. Make a box for the xpm file (Bitmap graphic file) and label 2. Make a pixmap from the xpm file 3. Make a label for the button 4. Packing the pixmap and label into the button
2
Make The Toolbar and Label
Make the box for the xpm file and label box1 = gtk_hbox_new (FALSE, 0); Make the pixmap from the xpm file pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask, &style->bg[GTK_STATE_NORMAL], xpm_filename); pixmapwid = gtk_pixmap_new (pixmap, mask); Make the label for the button label = gtk_label_new (label_text); Packing the pixmap and label into the button gtk_box_pack_start (GTK_BOX (box1), pixmapwid, FALSE, FALSE, 3); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 3); gtk_widget_show(pixmapwid); gtk_widget_show(label);
3
Using The Toolbar in Main Program
Make a new button button = gtk_button_new (); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (callback), (gpointer) "cool button"); Make a box box1 = xpm_label_box(window, "info.xpm", "cool button"); Packing The Button and Show it gtk_widget_show(box1); gtk_container_add (GTK_CONTAINER (button), box1); gtk_widget_show(button); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (window);
4
Running Screen
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.