only for RuBoard - do not distribute or recompile |
The next two listings are the interface.c and kbi.glade files for the KBI executable created in Chapter 12.
Listing C.1 is the Glade-generated file for creating the interface to KBI (the executable). It creates the form and returns a pointer to the newly created frm_kbi.
/* DO NOT EDIT THIS FILE - it is generated by Glade. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <string.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> #include "callbacks.h" #include "interface.h" #include "support.h" GtkWidget* create_frm_kbi (void) { GtkWidget *frm_kbi; GtkWidget *vbox1; GtkWidget *lst_reports; GtkWidget *hbox_buttons; GtkWidget *cmd_close; GtkWidget *cmd_open; GtkWidget *statusbar1; frm_kbi = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_object_set_data (GTK_OBJECT (frm_kbi), "frm_kbi", frm_kbi); gtk_window_set_title (GTK_WINDOW (frm_kbi), "Key Business Indicators"); gtk_window_set_default_size (GTK_WINDOW (frm_kbi), 240, 300); vbox1 = gtk_vbox_new (FALSE, 0); gtk_widget_ref (vbox1); gtk_object_set_data_full (GTK_OBJECT (frm_kbi), "vbox1", vbox1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (vbox1); gtk_container_add (GTK_CONTAINER (frm_kbi), vbox1); lst_reports = gtk_list_new (); gtk_widget_ref (lst_reports); gtk_object_set_data_full (GTK_OBJECT (frm_kbi), "lst_reports", lst_reports, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (lst_reports); gtk_box_pack_start (GTK_BOX (vbox1), lst_reports, TRUE, TRUE, 0); hbox_buttons = gtk_hbox_new (FALSE, 0); gtk_widget_ref (hbox_buttons); gtk_object_set_data_full (GTK_OBJECT (frm_kbi), "hbox_buttons", hbox_buttons, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (hbox_buttons); gtk_box_pack_start (GTK_BOX (vbox1), hbox_buttons, FALSE, TRUE, 0); cmd_close = gtk_button_new_with_label ("Close"); gtk_widget_ref (cmd_close); gtk_object_set_data_full (GTK_OBJECT (frm_kbi), "cmd_close", cmd_close, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cmd_close); gtk_box_pack_start (GTK_BOX (hbox_buttons), cmd_close, TRUE, TRUE, 0); cmd_open = gtk_button_new_with_label ("Open"); gtk_widget_ref (cmd_open); gtk_object_set_data_full (GTK_OBJECT (frm_kbi), "cmd_open", cmd_open, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cmd_open); gtk_box_pack_start (GTK_BOX (hbox_buttons), cmd_open, TRUE, TRUE, 0); statusbar1 = gtk_statusbar_new (); gtk_widget_ref (statusbar1); gtk_object_set_data_full (GTK_OBJECT (frm_kbi), "statusbar1", statusbar1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (statusbar1); gtk_box_pack_start (GTK_BOX (vbox1), statusbar1, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (frm_kbi), "realize", GTK_SIGNAL_FUNC (on_frm_kbi_realize), NULL); gtk_signal_connect (GTK_OBJECT (frm_kbi), "show", GTK_SIGNAL_FUNC (on_frm_kbi_show), NULL); gtk_signal_connect (GTK_OBJECT (frm_kbi), "delete_event", GTK_SIGNAL_FUNC (on_frm_kbi_delete_event), NULL); gtk_signal_connect (GTK_OBJECT (cmd_close), "clicked", GTK_SIGNAL_FUNC (on_cmd_close_clicked), NULL); gtk_signal_connect (GTK_OBJECT (cmd_open), "clicked", GTK_SIGNAL_FUNC (on_cmd_open_clicked), NULL); return frm_kbi; }
Listing C.2 is the Glade project file for the KBI executable; it is generated by Glade in
XML format.
<?xml version="1.0"?> <GTK-Interface> <project> <name>kbi</name> <program_name>kbi</program_name> <directory></directory> <source_directory>src</source_directory> <pixmaps_directory>pixmaps</pixmaps_directory> <language>C</language> <gnome_support>False</gnome_support> <gettext_support>False</gettext_support> <use_widget_names>False</use_widget_names> <output_main_file>True</output_main_file> <output_support_files>True</output_support_files> <output_build_files>True</output_build_files> <backup_source_files>True</backup_source_files> <main_source_file>interface.c</main_source_file> <main_header_file>interface.h</main_header_file> <handler_source_file>callbacks.c</handler_source_file> <handler_header_file>callbacks.h</handler_header_file> <support_source_file>support.c</support_source_file> <support_header_file>support.h</support_header_file> <translatable_strings_file></translatable_strings_file> </project> <widget> <class>GtkWindow</class> <name>frm_kbi</name> <signal> <name>realize</name> <handler>on_frm_kbi_realize</handler> <last_modification_time>Wed, 14 Feb 2001 12:01:32 GMT</last_modification_time> </signal> <signal> <name>show</name> <handler>on_frm_kbi_show</handler> <last_modification_time>Wed, 14 Feb 2001 12:24:29 GMT</last_modification_time> </signal> <signal> <name>delete_event</name> <handler>on_frm_kbi_delete_event</handler> <last_modification_time>Wed, 14 Feb 2001 12:30:44 GMT</last_modification_time> </signal> <title>Key Business Indicators</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> <default_width>240</default_width> <default_height>300</default_height> <allow_shrink>False</allow_shrink> <allow_grow>True</allow_grow> <auto_shrink>False</auto_shrink> <widget> <class>GtkVBox</class> <name>vbox1</name> <homogeneous>False</homogeneous> <spacing>0</spacing> <widget> <class>GtkList</class> <name>lst_reports</name> <selection_mode>GTK_SELECTION_SINGLE</selection_mode> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> <widget> <class>GtkHBox</class> <name>hbox_buttons</name> <homogeneous>False</homogeneous> <spacing>0</spacing> <child> <padding>0</padding> <expand>False</expand> <fill>True</fill> </child> <widget> <class>GtkButton</class> <name>cmd_close</name> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_cmd_close_clicked</handler> <last_modification_time>Mon, 12 Feb 2001 20:34:11 GMT</last_modification_time> </signal> <label>Close</label> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> <widget> <class>GtkButton</class> <name>cmd_open</name> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_cmd_open_clicked</handler> <last_modification_time>Mon, 12 Feb 2001 20:34:22 GMT</last_modification_time> </signal> <label>Open</label> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> </widget> <widget> <class>GtkStatusbar</class> <name>statusbar1</name> <child> <padding>0</padding> <expand>False</expand> <fill>False</fill> </child> </widget> </widget> </widget> </GTK-Interface>
only for RuBoard - do not distribute or recompile |