diff options
Diffstat (limited to 'src/gui/menus/file.c')
-rw-r--r-- | src/gui/menus/file.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/gui/menus/file.c b/src/gui/menus/file.c new file mode 100644 index 0000000..880fb8a --- /dev/null +++ b/src/gui/menus/file.c @@ -0,0 +1,91 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * file.c - gestion du menu 'Fichier' + * + * Copyright (C) 2011 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "file.h" + + +#include <i18n.h> + + +#include "../../gtkext/easygtk.h" + + + +/* Réagit avec le menu "Fichier -> Quitter". */ +static void mcb_file_quit(GtkMenuItem *, GObject *); + + + +/****************************************************************************** +* * +* Paramètres : ref = espace de référencement global. * +* accgroup = groupe d'accélérateurs pour les menus. * +* * +* Description : Construit le menu "Fichier". * +* * +* Retour : Panneau de menus mis en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *build_menu_file(GObject *ref, GtkAccelGroup *accgroup) +{ + GtkWidget *result; /* Support à retourner */ + GtkWidget *menubar; /* Support pour éléments */ + GtkWidget *submenuitem; /* Sous-élément de menu */ + + 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); + + submenuitem = qck_create_menu_item(NULL, NULL, _("Quit"), G_CALLBACK(mcb_file_quit), ref); + add_accelerator_to_menu_item(submenuitem, "<Ctrl>Q", accgroup); + gtk_container_add(GTK_CONTAINER(menubar), submenuitem); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : menuitem = élément de menu sélectionné. * +* ref = adresse de l'espace de référencement global. * +* * +* Description : Réagit avec le menu "Fichier -> Quitter". * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void mcb_file_quit(GtkMenuItem *menuitem, GObject *ref) +{ + gtk_main_quit(); + +} |