Presentation is loading. Please wait.

Presentation is loading. Please wait.

Development of The Menu System

Similar presentations


Presentation on theme: "Development of The Menu System"— Presentation transcript:

1 Development of The Menu System
KwangWoo Choi Department of Physics Kangwon National University Steps for the menu system 1. Show a window 2. Start the menu widget 3. Enter the menu entry 4. Set the action to the menu item 5. Make menu bar and show it 6. Reshow a whole window

2 Show A Window Start The Menu Widget
Make a 640x480 window with its title of “Bifurcation Plotter.” window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize( GTK_WIDGET (window), 640, 480); gtk_window_set_title(GTK_WINDOW (window), "Bifurcation Plotter"); Start The Menu Widget menu = gtk_menu_new();

3 Set Root and Child Menu Items
Set the root menu and show it. /* Set the menu item */ plot_menu = gtk_menu_item_new_with_label("Plot"); root_menu = gtk_menu_item_new_with_label("Setting"); /* Show the menu item */ gtk_widget_show(plot_menu); gtk_widget_show(root_menu); Set the child menu and set the action to the menu item. /* Set the child menu */ menu_items = gtk_menu_item_new_with_label("Set Parameters"); gtk_menu_append(GTK_MENU (menu), menu_items); /* Set the action to the menu item (e.g. menuitem_response)*/ gtk_signal_connect (GTK_OBJECT(menu_items), "activate", GTK_SIGNAL_FUNC(menuitem_response), (gpointer) g_strdup(buf));

4 Set Root and Child Menu Items
Define the action. static void menuitem_response (GtkWidget *widget, gchar *string) { printf("%s\n", string); } Running screen of “Bifurcation Plotter”


Download ppt "Development of The Menu System"

Similar presentations


Ads by Google