interface.c
Go to the documentation of this file.
1 /*
2  * DO NOT EDIT THIS FILE - it is generated by Glade.
3  */
4 
5 #include <sys/types.h>
6 #include <sys/stat.h>
7 #include <unistd.h>
8 #include <string.h>
9 
10 #include <gdk/gdkkeysyms.h>
11 #include <gtk/gtk.h>
12 
13 #include "callbacks.h"
14 #include "interface.h"
15 
16 GtkWidget*
18 {
19  GtkWidget *window;
20  GtkWidget *vbox1;
21  extern GtkWidget *draw_main;
22  GtkWidget *hbox1;
23  GtkWidget *button_change;
24  GtkWidget *button_run;
25  GtkWidget *button_clear;
26  GtkWidget *button_save;
27  GtkWidget *button_load;
28  extern GtkWidget *entry_option;
29 
30  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
31  gtk_object_set_data (GTK_OBJECT (window), "window", window);
32  gtk_window_set_title (GTK_WINDOW (window), "SVM Toy");
33 
34  vbox1 = gtk_vbox_new (FALSE, 0);
35  gtk_widget_ref (vbox1);
36  gtk_object_set_data_full (GTK_OBJECT (window), "vbox1", vbox1,
37  (GtkDestroyNotify) gtk_widget_unref);
38  gtk_widget_show (vbox1);
39  gtk_container_add (GTK_CONTAINER (window), vbox1);
40 
41  draw_main = gtk_drawing_area_new ();
42  gtk_widget_ref (draw_main);
43  gtk_object_set_data_full (GTK_OBJECT (window), "draw_main", draw_main,
44  (GtkDestroyNotify) gtk_widget_unref);
45  gtk_widget_show (draw_main);
46  gtk_box_pack_start (GTK_BOX (vbox1), draw_main, TRUE, TRUE, 0);
47  gtk_widget_set_usize (draw_main, 500, 500);
48  gtk_widget_set_events (draw_main, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
49 
50  hbox1 = gtk_hbox_new (FALSE, 0);
51  gtk_widget_ref (hbox1);
52  gtk_object_set_data_full (GTK_OBJECT (window), "hbox1", hbox1,
53  (GtkDestroyNotify) gtk_widget_unref);
54  gtk_widget_show (hbox1);
55  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
56 
57  button_change = gtk_button_new_with_label ("Change");
58  gtk_widget_ref (button_change);
59  gtk_object_set_data_full (GTK_OBJECT (window), "button_change", button_change,
60  (GtkDestroyNotify) gtk_widget_unref);
61  gtk_widget_show (button_change);
62  gtk_box_pack_start (GTK_BOX (hbox1), button_change, FALSE, FALSE, 0);
63 
64  button_run = gtk_button_new_with_label ("Run");
65  gtk_widget_ref (button_run);
66  gtk_object_set_data_full (GTK_OBJECT (window), "button_run", button_run,
67  (GtkDestroyNotify) gtk_widget_unref);
68  gtk_widget_show (button_run);
69  gtk_box_pack_start (GTK_BOX (hbox1), button_run, FALSE, FALSE, 0);
70 
71  button_clear = gtk_button_new_with_label ("Clear");
72  gtk_widget_ref (button_clear);
73  gtk_object_set_data_full (GTK_OBJECT (window), "button_clear", button_clear,
74  (GtkDestroyNotify) gtk_widget_unref);
75  gtk_widget_show (button_clear);
76  gtk_box_pack_start (GTK_BOX (hbox1), button_clear, FALSE, FALSE, 0);
77 
78  button_save = gtk_button_new_with_label ("Save");
79  gtk_widget_ref (button_save);
80  gtk_object_set_data_full (GTK_OBJECT (window), "button_save", button_save,
81  (GtkDestroyNotify) gtk_widget_unref);
82  gtk_widget_show (button_save);
83  gtk_box_pack_start (GTK_BOX (hbox1), button_save, FALSE, FALSE, 0);
84 
85  button_load = gtk_button_new_with_label ("Load");
86  gtk_widget_ref (button_load);
87  gtk_object_set_data_full (GTK_OBJECT (window), "button_load", button_load,
88  (GtkDestroyNotify) gtk_widget_unref);
89  gtk_widget_show (button_load);
90  gtk_box_pack_start (GTK_BOX (hbox1), button_load, FALSE, FALSE, 0);
91 
92  entry_option = gtk_entry_new ();
93  gtk_widget_ref (entry_option);
94  gtk_object_set_data_full (GTK_OBJECT (window), "entry_option", entry_option,
95  (GtkDestroyNotify) gtk_widget_unref);
96  gtk_widget_show (entry_option);
97  gtk_box_pack_start (GTK_BOX (hbox1), entry_option, TRUE, TRUE, 0);
98 
99  gtk_signal_connect (GTK_OBJECT (window), "destroy",
100  GTK_SIGNAL_FUNC (on_window1_destroy),
101  NULL);
102  gtk_signal_connect (GTK_OBJECT (draw_main), "button_press_event",
103  GTK_SIGNAL_FUNC (on_draw_main_button_press_event),
104  NULL);
105  gtk_signal_connect (GTK_OBJECT (draw_main), "expose_event",
106  GTK_SIGNAL_FUNC (on_draw_main_expose_event),
107  NULL);
108  gtk_signal_connect (GTK_OBJECT (button_change), "clicked",
109  GTK_SIGNAL_FUNC (on_button_change_clicked),
110  NULL);
111  gtk_signal_connect (GTK_OBJECT (button_run), "clicked",
112  GTK_SIGNAL_FUNC (on_button_run_clicked),
113  NULL);
114  gtk_signal_connect (GTK_OBJECT (button_clear), "clicked",
115  GTK_SIGNAL_FUNC (on_button_clear_clicked),
116  NULL);
117  gtk_signal_connect (GTK_OBJECT (button_save), "clicked",
118  GTK_SIGNAL_FUNC (on_button_save_clicked),
119  NULL);
120  gtk_signal_connect (GTK_OBJECT (button_load), "clicked",
121  GTK_SIGNAL_FUNC (on_button_load_clicked),
122  NULL);
123  gtk_signal_connect (GTK_OBJECT (entry_option), "activate",
124  GTK_SIGNAL_FUNC (on_button_run_clicked),
125  NULL);
126 
127  return window;
128 }
129 
130 GtkWidget*
132 {
133  GtkWidget *fileselection;
134  GtkWidget *filesel_ok;
135  GtkWidget *filesel_cancel;
136 
137  fileselection = gtk_file_selection_new ("Select File");
138  gtk_object_set_data (GTK_OBJECT (fileselection), "fileselection", fileselection);
139  gtk_container_set_border_width (GTK_CONTAINER (fileselection), 10);
140  gtk_window_set_modal (GTK_WINDOW (fileselection), TRUE);
141 
142  filesel_ok = GTK_FILE_SELECTION (fileselection)->ok_button;
143  gtk_object_set_data (GTK_OBJECT (fileselection), "filesel_ok", filesel_ok);
144  gtk_widget_show (filesel_ok);
145  GTK_WIDGET_SET_FLAGS (filesel_ok, GTK_CAN_DEFAULT);
146 
147  filesel_cancel = GTK_FILE_SELECTION (fileselection)->cancel_button;
148  gtk_object_set_data (GTK_OBJECT (fileselection), "filesel_cancel", filesel_cancel);
149  gtk_widget_show (filesel_cancel);
150  GTK_WIDGET_SET_FLAGS (filesel_cancel, GTK_CAN_DEFAULT);
151 
152  gtk_signal_connect (GTK_OBJECT (fileselection), "destroy",
153  GTK_SIGNAL_FUNC (on_fileselection_destroy),
154  NULL);
155  gtk_signal_connect (GTK_OBJECT (filesel_ok), "clicked",
156  GTK_SIGNAL_FUNC (on_filesel_ok_clicked),
157  NULL);
158  gtk_signal_connect (GTK_OBJECT (filesel_cancel), "clicked",
159  GTK_SIGNAL_FUNC (on_filesel_cancel_clicked),
160  NULL);
161 
162  return fileselection;
163 }
164 
GtkWidget * fileselection
Definition: callbacks.cpp:338
gboolean on_draw_main_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
Definition: callbacks.cpp:317
void on_button_load_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:367
void on_fileselection_destroy(GtkObject *object, gpointer user_data)
Definition: callbacks.cpp:438
void on_button_clear_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:303
void on_filesel_ok_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:375
void on_button_change_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:91
GtkWidget * draw_main
Definition: callbacks.cpp:29
GtkWidget * create_fileselection(void)
Definition: interface.c:131
void on_button_run_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:99
GtkWidget * entry_option
Definition: callbacks.cpp:31
void on_button_save_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:358
void on_filesel_cancel_clicked(GtkButton *button, gpointer user_data)
Definition: callbacks.cpp:444
gboolean on_draw_main_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
Definition: callbacks.cpp:328
GtkWidget * create_window(void)
Definition: interface.c:17
void on_window1_destroy(GtkObject *object, gpointer user_data)
Definition: callbacks.cpp:310


haf_grasping
Author(s): David Fischinger
autogenerated on Mon Jun 10 2019 13:28:43