gtk_widget_show (box); return TRUE; } GnomeUIInfo gamemenu[] = { GNOMEUIINFO_MENU_NEW_GAME_ITEM(game_new_callback, NULL), GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_SCORES_ITEM(game_top_ten_callback, NULL), GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_EXIT_ITEM(game_quit_callback, NULL), GNOMEUIINFO_END }; GnomeUIInfo settingsmenu[] = { GNOMEUIINFO_MENU_PREFERENCES_ITEM(game_preferences_callback, NULL), GNOMEUIINFO_END }; GnomeUIInfo helpmenu[] = { GNOMEUIINFO_HELP("samegnome"), GNOMEUIINFO_MENU_ABOUT_ITEM(game_about_callback, NULL),
static void shutdown(GtkObject *object, gpointer data) { gtk_main_quit(); } GnomeUIInfo fileMenu[] = { GNOMEUIINFO_MENU_NEW_ITEM((gchar *) "_New Sample", (gchar *) "Create a new Gnome Layout Sample", newapp, NULL), GNOMEUIINFO_MENU_OPEN_ITEM(openfile, NULL), GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_CLOSE_ITEM(closeapp, NULL), GNOMEUIINFO_MENU_EXIT_ITEM(shutdown, NULL), GNOMEUIINFO_END }; GnomeUIInfo helpMenu[] = { /* GNOMEUIINFO_HELP("gnomelayout"), */ GNOMEUIINFO_MENU_ABOUT_ITEM(showabout, NULL), GNOMEUIINFO_END }; GnomeUIInfo mainMenu[] = { GNOMEUIINFO_SUBTREE(N_((gchar *) "File"), fileMenu), GNOMEUIINFO_SUBTREE(N_((gchar *) "Help"), helpMenu), GNOMEUIINFO_END
#include "calc.h" /* Global variables */ GtkWidget *app; //!< Main application window GtkWidget *entryNr; //!< Entry widget for number of resistors GtkWidget *entryV; //!< Entry widget for voltage GtkWidget *entryR1; //!< Entry widget for resistor value number 1 GtkWidget *entryR2; //!< Entry widget for resistor value number 2 GtkWidget *entryR3; //!< Entry widget for resistor value number 3 GtkWidget *radioSerial; //!< Radio buttons for serial connection type GtkWidget *radioParalell; //!< Radio buttons for parallel connection type static GnomeUIInfo filemenu[] = { GNOMEUIINFO_MENU_EXIT_ITEM ( closeApp, NULL ), GNOMEUIINFO_END };//!< File menu item static GnomeUIInfo helpmenu[] = { GNOMEUIINFO_MENU_ABOUT_ITEM ( onAboutActivate, NULL ), GNOMEUIINFO_END };//!< Help menu item static GnomeUIInfo menubar[] = { GNOMEUIINFO_MENU_FILE_TREE (filemenu), GNOMEUIINFO_MENU_HELP_TREE (helpmenu), GNOMEUIINFO_END };//!< Menubar for the application GtkWidget *createMainWindow( void ) { GtkWidget *app;//!< Main container
#endif #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <string.h> #include <gnome.h> #include "callbacks.h" #include "interface.h" #include "support.h" static GnomeUIInfo file1_menu_uiinfo[] = { GNOMEUIINFO_MENU_EXIT_ITEM (on_exit1_activate, NULL), GNOMEUIINFO_END }; static GnomeUIInfo help1_menu_uiinfo[] = { GNOMEUIINFO_MENU_ABOUT_ITEM (on_about1_activate, NULL), GNOMEUIINFO_END }; static GnomeUIInfo menubar1_uiinfo[] = { GNOMEUIINFO_MENU_FILE_TREE (file1_menu_uiinfo), GNOMEUIINFO_MENU_HELP_TREE (help1_menu_uiinfo), GNOMEUIINFO_END };
{ GNOME_APP_UI_ITEM, "_Open...", "Open an existing file", item_activated, "file/open", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, 'o', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Save", "Save the current file", item_activated, "file/save", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 's', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "Save _as...", "Save the current file with a new name", item_activated, "file/save as", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE_AS, 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, "_Print...", "Print the current file", item_activated, "file/print", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PRINT, 'p', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_CLOSE_ITEM(item_activated, "file/close"), GNOMEUIINFO_MENU_EXIT_ITEM(item_activated, "file/exit"), GNOMEUIINFO_END }; static GnomeUIInfo helper_edit_menu[] = { { GNOME_APP_UI_ITEM, "_Undo", "Undo the last operation", item_activated, "edit/undo", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_UNDO, 'z', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Redo", "Redo the last undo-ed operation", item_activated, "edit/redo", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REDO, 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, "Cu_t", "Cut the selection to the clipboard", item_activated, "edit/cut", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CUT, 'x', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Copy", "Copy the selection to the clipboard", item_activated, "edit/copy", NULL,
#define CLIENT_APP #include "../common/common.h" #include "main.h" #define GLADE_HOOKUP_OBJECT(component,widget,name) gtk_object_set_data_full (GTK_OBJECT (component), name, gtk_widget_ref (widget), (GtkDestroyNotify) gtk_widget_unref) #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) gtk_object_set_data (GTK_OBJECT (component), name, widget) static GnomeUIInfo conn_menu_uiinfo[] = { {GNOME_APP_UI_ITEM, N_("C_onnect"), NULL, (gpointer) on_Connect, NULL, NULL, 0, NULL, 0, 0, NULL}, {GNOME_APP_UI_ITEM, N_("_Disconnect"),NULL,(gpointer) on_mnuDisconect_activate, NULL, NULL,0, NULL,0, 0, NULL}, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_EXIT_ITEM (gtk_main_quit, NULL), GNOMEUIINFO_END }; static GnomeUIInfo mnuContacts_menu_uiinfo[] = { {GNOME_APP_UI_ITEM, N_("_Add"), NULL, (gpointer) on_Add, NULL, NULL, 0, NULL, 0, 0, NULL}, {GNOME_APP_UI_ITEM, N_("_Delete"),NULL, (gpointer) on_mnuDelete_activate, NULL, NULL, 0, NULL, 0, 0, NULL}, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("_Offline Messages"), NULL, (gpointer) on_Offline, NULL, NULL, 0, NULL, 0, 0, NULL}, GNOMEUIINFO_END }; static GnomeUIInfo mnuHelp_menu_uiinfo[] = { GNOMEUIINFO_MENU_ABOUT_ITEM (on_mnuAbout_activate, NULL), GNOMEUIINFO_END