only for RuBoard - do not distribute or recompile |
Listing C.9 is the interface.c for the scatter plot example program, and Listing C.9 is the corresponding Glade XML file.
Listing C.9 is the Glade-generated file for building the interface for the scatter plot program.
/* 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_scatter (void) { GtkWidget *frm_scatter; GtkWidget *vbox1; GtkWidget *hbox1; GtkWidget *label1; GtkWidget *cbo_horizontal; GList *cbo_horizontal_items = NULL; GtkWidget *combo_entry1; GtkWidget *label2; GtkWidget *cbo_vertical; GList *cbo_vertical_items = NULL; GtkWidget *combo_entry2; GtkWidget *cmd_redraw; GtkWidget *drawingarea1; GtkWidget *statusbar1; frm_scatter = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_object_set_data (GTK_OBJECT (frm_scatter), "frm_scatter", frm_scatter); gtk_window_set_title (GTK_WINDOW (frm_scatter), "Numeric Correlation - Revenue Data"); gtk_window_set_default_size (GTK_WINDOW (frm_scatter), 900, 650); vbox1 = gtk_vbox_new (FALSE, 0); gtk_widget_ref (vbox1); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "vbox1", vbox1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (vbox1); gtk_container_add (GTK_CONTAINER (frm_scatter), vbox1); hbox1 = gtk_hbox_new (FALSE, 35); gtk_widget_ref (hbox1); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "hbox1", hbox1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (hbox1); gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox1), 19); label1 = gtk_label_new ("Horizontal Axis:"); gtk_widget_ref (label1); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "label1", label1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (label1); gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0); cbo_horizontal = gtk_combo_new (); gtk_widget_ref (cbo_horizontal); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "cbo_horizontal", cbo_horizontal, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cbo_horizontal); gtk_box_pack_start (GTK_BOX (hbox1), cbo_horizontal, TRUE, TRUE, 0); cbo_horizontal_items = g_list_append (cbo_horizontal_items, "Unit Price"); cbo_horizontal_items = g_list_append (cbo_horizontal_items, "Net Value"); cbo_horizontal_items = g_list_append (cbo_horizontal_items, "Invoice Quantity"); cbo_horizontal_items = g_list_append (cbo_horizontal_items, "Invoice Value"); cbo_horizontal_items = g_list_append (cbo_horizontal_items, "Order Quantity"); gtk_combo_set_popdown_strings (GTK_COMBO (cbo_horizontal), cbo_horizontal_items); g_list_free (cbo_horizontal_items); combo_entry1 = GTK_COMBO (cbo_horizontal)->entry; gtk_widget_ref (combo_entry1); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "combo_entry1", combo_entry1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (combo_entry1); gtk_entry_set_text (GTK_ENTRY (combo_entry1), "Unit Price"); label2 = gtk_label_new ("Vertical Axis"); gtk_widget_ref (label2); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "label2", label2, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (label2); gtk_box_pack_start (GTK_BOX (hbox1), label2, FALSE, FALSE, 0); cbo_vertical = gtk_combo_new (); gtk_widget_ref (cbo_vertical); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "cbo_vertical", cbo_vertical, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cbo_vertical); gtk_box_pack_start (GTK_BOX (hbox1), cbo_vertical, TRUE, TRUE, 0); cbo_vertical_items = g_list_append (cbo_vertical_items, "Order Quantity"); cbo_vertical_items = g_list_append (cbo_vertical_items, "Unit Price"); cbo_vertical_items = g_list_append (cbo_vertical_items, "Net Value"); cbo_vertical_items = g_list_append (cbo_vertical_items, "Invoice Quantity"); cbo_vertical_items = g_list_append (cbo_vertical_items, "Invoice Value"); gtk_combo_set_popdown_strings (GTK_COMBO (cbo_vertical), cbo_vertical_items); g_list_free (cbo_vertical_items); combo_entry2 = GTK_COMBO (cbo_vertical)->entry; gtk_widget_ref (combo_entry2); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "combo_entry2", combo_entry2, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (combo_entry2); gtk_entry_set_text (GTK_ENTRY (combo_entry2), "Order Quantity"); cmd_redraw = gtk_button_new_with_label ("Redraw"); gtk_widget_ref (cmd_redraw); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "cmd_redraw", cmd_redraw, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cmd_redraw); gtk_box_pack_start (GTK_BOX (hbox1), cmd_redraw, TRUE, TRUE, 0); drawingarea1 = gtk_drawing_area_new (); gtk_widget_ref (drawingarea1); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "drawingarea1", drawingarea1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (drawingarea1); gtk_box_pack_start (GTK_BOX (vbox1), drawingarea1, TRUE, TRUE, 0); statusbar1 = gtk_statusbar_new (); gtk_widget_ref (statusbar1); gtk_object_set_data_full (GTK_OBJECT (frm_scatter), "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_scatter), "delete_event", GTK_SIGNAL_FUNC (on_frm_scatter_delete_event), NULL); gtk_signal_connect (GTK_OBJECT (frm_scatter), "show", GTK_SIGNAL_FUNC (on_frm_scatter_show), NULL); gtk_signal_connect (GTK_OBJECT (frm_scatter), "event", GTK_SIGNAL_FUNC (on_frm_scatter_event), NULL); gtk_signal_connect (GTK_OBJECT (cmd_redraw), "clicked", GTK_SIGNAL_FUNC (on_cmd_redraw_clicked), NULL); gtk_signal_connect (GTK_OBJECT (drawingarea1), "event", GTK_SIGNAL_FUNC (on_drawingarea1_event), NULL); return frm_scatter; }
Listing C.10 is the Glade project file for the scatter program in XML format.
<?xml version="1.0"?> <GTK-Interface> <project> <name>scatter</name> <program_name>scatter</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_scatter</name> <signal> <name>delete_event</name> <handler>on_frm_scatter_delete_event</handler> <last_modification_time>Sun, 25 Feb 2001 22:05:08 GMT</last_modification_time> </signal> <signal> <name>show</name> <handler>on_frm_scatter_show</handler> <last_modification_time>Sun, 25 Feb 2001 22:05:18 GMT</last_modification_time> </signal> <signal> <name>event</name> <handler>on_frm_scatter_event</handler> <last_modification_time>Tue, 27 Feb 2001 20:34:23 GMT</last_modification_time> </signal> <title>Numeric Correlation - Revenue Data</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> <default_width>900</default_width> <default_height>650</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>GtkHBox</class> <name>hbox1</name> <border_width>19</border_width> <homogeneous>False</homogeneous> <spacing>35</spacing> <child> <padding>0</padding> <expand>False</expand> <fill>True</fill> </child> <widget> <class>GtkLabel</class> <name>label1</name> <label>Horizontal Axis:</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <padding>0</padding> <expand>False</expand> <fill>False</fill> </child> </widget> <widget> <class>GtkCombo</class> <name>cbo_horizontal</name> <value_in_list>False</value_in_list> <ok_if_empty>True</ok_if_empty> <case_sensitive>False</case_sensitive> <use_arrows>True</use_arrows> <use_arrows_always>False</use_arrows_always> <items>Unit Price Net Value Invoice Quantity Invoice Value Order Quantity </items> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> <widget> <class>GtkEntry</class> <child_name>GtkCombo:entry</child_name> <name>combo-entry1</name> <can_focus>True</can_focus> <editable>True</editable> <text_visible>True</text_visible> <text_max_length>0</text_max_length> <text>Unit Price</text> </widget> </widget> <widget> <class>GtkLabel</class> <name>label2</name> <label>Vertical Axis</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <padding>0</padding> <expand>False</expand> <fill>False</fill> </child> </widget> <widget> <class>GtkCombo</class> <name>cbo_vertical</name> <value_in_list>False</value_in_list> <ok_if_empty>True</ok_if_empty> <case_sensitive>False</case_sensitive> <use_arrows>True</use_arrows> <use_arrows_always>False</use_arrows_always> <items>Order Quantity Unit Price Net Value Invoice Quantity Invoice Value </items> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> <widget> <class>GtkEntry</class> <child_name>GtkCombo:entry</child_name> <name>combo-entry2</name> <can_focus>True</can_focus> <editable>True</editable> <text_visible>True</text_visible> <text_max_length>0</text_max_length> <text>Order Quantity</text> </widget> </widget> <widget> <class>GtkButton</class> <name>cmd_redraw</name> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_cmd_redraw_clicked</handler> <last_modification_time>Sun, 25 Feb 2001 22:05:39 GMT</last_modification_time> </signal> <label>Redraw</label> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> </widget> <widget> <class>GtkDrawingArea</class> <name>drawingarea1</name> <signal> <name>event</name> <handler>on_drawingarea1_event</handler> <last_modification_time>Sun, 25 Feb 2001 22:05:53 GMT</last_modification_time> </signal> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </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 |