diff options
Diffstat (limited to 'src/gui/menus')
-rw-r--r-- | src/gui/menus/binary.c | 3 | ||||
-rw-r--r-- | src/gui/menus/debug.c | 3 | ||||
-rw-r--r-- | src/gui/menus/edition.c | 12 | ||||
-rw-r--r-- | src/gui/menus/file.c | 5 | ||||
-rw-r--r-- | src/gui/menus/help.c | 3 | ||||
-rw-r--r-- | src/gui/menus/plugins.c | 3 | ||||
-rw-r--r-- | src/gui/menus/project.c | 9 | ||||
-rw-r--r-- | src/gui/menus/view.c | 6 |
8 files changed, 15 insertions, 29 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c index af6e8c4..0eb28fe 100644 --- a/src/gui/menus/binary.c +++ b/src/gui/menus/binary.c @@ -73,8 +73,7 @@ GtkWidget *build_menu_binary(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *ba result = gtk_menu_item_new_with_mnemonic(_("_Binary")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); submenuitem = qck_create_menu_item(ref, "mnu_binary_epoints", _("Entry points"), G_CALLBACK(mcb_binary_entry_points), bar); diff --git a/src/gui/menus/debug.c b/src/gui/menus/debug.c index 79b5ff8..cb270ff 100644 --- a/src/gui/menus/debug.c +++ b/src/gui/menus/debug.c @@ -93,8 +93,7 @@ GtkWidget *build_menu_debug(GObject *ref, GtkAccelGroup *accgroup) result = gtk_menu_item_new_with_mnemonic(_("_Debug")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); submenuitem = qck_create_menu_item(ref, "mnu_debug_continue", _("Continue"), G_CALLBACK(mcb_debug_continue), ref); diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index 31fbc0d..f41111d 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -100,8 +100,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b result = gtk_menu_item_new_with_mnemonic(_("_Edition")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); submenuitem = qck_create_menu_item(NULL, NULL, _("Go to address..."), G_CALLBACK(mcb_edition_goto), bar); @@ -114,8 +113,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b submenuitem = qck_create_menu_item(NULL, NULL, _("Numeric operand"), NULL, NULL); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - deepmenubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(submenuitem), deepmenubar); + deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem)); deepmenuitem = qck_create_menu_item(ref, "mnu_edit_switch_hex", _("Hexadecimal"), G_CALLBACK(mcb_edition_switch_numeric_operand), bar); @@ -181,8 +179,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b submenuitem = qck_create_menu_item(NULL, NULL, _("Bookmarks"), NULL, NULL); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - deepmenubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(submenuitem), deepmenubar); + deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem)); deepmenuitem = qck_create_menu_item(NULL, NULL, _("Toggle at current location"), G_CALLBACK(mcb_edition_bookmarks_toggle), bar); @@ -198,8 +195,7 @@ GtkWidget *build_menu_edition(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b submenuitem = qck_create_menu_item(NULL, NULL, _("Comments"), NULL, NULL); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - deepmenubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(submenuitem), deepmenubar); + deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem)); deepmenuitem = qck_create_menu_item(NULL, NULL, _("Enter a comment..."), G_CALLBACK(mcb_edition_comment_enter), bar); diff --git a/src/gui/menus/file.c b/src/gui/menus/file.c index cb69957..c3865b6 100644 --- a/src/gui/menus/file.c +++ b/src/gui/menus/file.c @@ -74,8 +74,7 @@ GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) result = gtk_menu_item_new_with_mnemonic(_("_File")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); submenuitem = qck_create_menu_item(NULL, NULL, _("New project"), G_CALLBACK(mcb_file_new_project), ref); @@ -299,6 +298,6 @@ static void mcb_file_save_project_as(GtkMenuItem *menuitem, gpointer data) static void mcb_file_quit(GtkMenuItem *menuitem, GObject *ref) { - gtk_main_quit(); + gtk_widget_destroy(GTK_WIDGET(ref)); } diff --git a/src/gui/menus/help.c b/src/gui/menus/help.c index 9293540..922fa31 100644 --- a/src/gui/menus/help.c +++ b/src/gui/menus/help.c @@ -60,8 +60,7 @@ GtkWidget *build_menu_help(GObject *ref, GtkAccelGroup *accgroup) result = gtk_menu_item_new_with_mnemonic(_("_Help")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); submenuitem = qck_create_menu_item(NULL, NULL, _("About"), G_CALLBACK(mcb_help_about), ref); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); diff --git a/src/gui/menus/plugins.c b/src/gui/menus/plugins.c index cba6b69..c1b0fc7 100644 --- a/src/gui/menus/plugins.c +++ b/src/gui/menus/plugins.c @@ -56,9 +56,8 @@ GtkWidget *build_menu_plugins(GObject *ref, GtkAccelGroup *accgroup) result = gtk_menu_item_new_with_mnemonic(_("_Plugins")); gtk_widget_show(result); - menubar = gtk_menu_new(); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); g_object_set_data(ref, "menubar_plugins", G_OBJECT(menubar)); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); return result; diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c index 58ef244..18c7aaa 100644 --- a/src/gui/menus/project.c +++ b/src/gui/menus/project.c @@ -74,14 +74,12 @@ GtkWidget *build_menu_project(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b result = gtk_menu_item_new_with_mnemonic(_("_Project")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); submenuitem = qck_create_menu_item(NULL, NULL, _("Add a binary..."), NULL, NULL); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - deepmenubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(submenuitem), deepmenubar); + deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem)); deepmenuitem = qck_create_menu_item(NULL, NULL, _("Shellcode"), G_CALLBACK(mcb_project_add_shellcode), bar); @@ -95,8 +93,7 @@ GtkWidget *build_menu_project(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *b NULL, NULL); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - deepmenubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(submenuitem), deepmenubar); + deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem)); return result; diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index 9f29ba3..70cd42e 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -82,8 +82,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) result = gtk_menu_item_new_with_mnemonic(_("_View")); gtk_widget_show(result); - menubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(result), menubar); + menubar = qck_create_menu(GTK_MENU_ITEM(result)); /* Affichage -> Panneaux latéraux */ @@ -91,8 +90,7 @@ GtkWidget *build_menu_view(GObject *ref, GtkAccelGroup *accgroup, GMenuBar *bar) g_signal_connect(submenuitem, "select", G_CALLBACK(mcb_view_update_side_panels_list), bar); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); - deepmenubar = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(submenuitem), deepmenubar); + deepmenubar = qck_create_menu(GTK_MENU_ITEM(submenuitem)); /* - */ |