15 #include <gdk/gdkkeysyms.h>
22 #define GLADE_HOOKUP_OBJECT(component,widget,name) \
23 g_object_set_data_full (G_OBJECT (component), name, \
24 gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
26 #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
27 g_object_set_data (G_OBJECT (component), name, widget)
41 GtkWidget *separatormenuitem1;
57 GtkWidget *drawingarea2;
58 GtkWidget *scrolledwindow3;
61 GtkIconSize tmp_toolbar_icon_size;
68 GtkWidget *scrolledwindow4;
70 GtkWidget *drawingarea1;
71 GtkAccelGroup *accel_group;
73 accel_group = gtk_accel_group_new ();
75 window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
76 gtk_window_set_title (GTK_WINDOW (window1),
"DotEdit");
78 vbox1 = gtk_vbox_new (
FALSE, 0);
79 gtk_widget_show (vbox1);
80 gtk_container_add (GTK_CONTAINER (window1), vbox1);
82 menubar1 = gtk_menu_bar_new ();
83 gtk_widget_show (menubar1);
84 gtk_box_pack_start (GTK_BOX (vbox1), menubar1,
FALSE,
FALSE, 0);
86 menuitem4 = gtk_menu_item_new_with_mnemonic (
_(
"_File"));
87 gtk_widget_show (menuitem4);
88 gtk_container_add (GTK_CONTAINER (menubar1), menuitem4);
90 menu4 = gtk_menu_new ();
91 gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menu4);
93 new1 = gtk_image_menu_item_new_from_stock (
"gtk-new", accel_group);
94 gtk_widget_show (new1);
95 gtk_container_add (GTK_CONTAINER (menu4), new1);
97 open1 = gtk_image_menu_item_new_from_stock (
"gtk-open", accel_group);
98 gtk_widget_show (open1);
99 gtk_container_add (GTK_CONTAINER (menu4), open1);
101 save1 = gtk_image_menu_item_new_from_stock (
"gtk-save", accel_group);
102 gtk_widget_show (save1);
103 gtk_container_add (GTK_CONTAINER (menu4), save1);
105 save_as1 = gtk_image_menu_item_new_from_stock (
"gtk-save-as", accel_group);
106 gtk_widget_show (save_as1);
107 gtk_container_add (GTK_CONTAINER (menu4), save_as1);
109 separatormenuitem1 = gtk_separator_menu_item_new ();
110 gtk_widget_show (separatormenuitem1);
111 gtk_container_add (GTK_CONTAINER (menu4), separatormenuitem1);
112 gtk_widget_set_sensitive (separatormenuitem1,
FALSE);
114 quit1 = gtk_image_menu_item_new_from_stock (
"gtk-quit", accel_group);
115 gtk_widget_show (quit1);
116 gtk_container_add (GTK_CONTAINER (menu4), quit1);
118 menuitem5 = gtk_menu_item_new_with_mnemonic (
_(
"_Edit"));
119 gtk_widget_show (menuitem5);
120 gtk_container_add (GTK_CONTAINER (menubar1), menuitem5);
122 menu5 = gtk_menu_new ();
123 gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem5), menu5);
125 cut1 = gtk_image_menu_item_new_from_stock (
"gtk-cut", accel_group);
126 gtk_widget_show (cut1);
127 gtk_container_add (GTK_CONTAINER (menu5), cut1);
129 copy1 = gtk_image_menu_item_new_from_stock (
"gtk-copy", accel_group);
130 gtk_widget_show (copy1);
131 gtk_container_add (GTK_CONTAINER (menu5), copy1);
133 paste1 = gtk_image_menu_item_new_from_stock (
"gtk-paste", accel_group);
134 gtk_widget_show (paste1);
135 gtk_container_add (GTK_CONTAINER (menu5), paste1);
137 delete1 = gtk_image_menu_item_new_from_stock (
"gtk-delete", accel_group);
138 gtk_widget_show (delete1);
139 gtk_container_add (GTK_CONTAINER (menu5), delete1);
141 menuitem6 = gtk_menu_item_new_with_mnemonic (
_(
"_View"));
142 gtk_widget_show (menuitem6);
143 gtk_container_add (GTK_CONTAINER (menubar1), menuitem6);
145 menu6 = gtk_menu_new ();
146 gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem6), menu6);
148 menuitem7 = gtk_menu_item_new_with_mnemonic (
_(
"_Help"));
149 gtk_widget_show (menuitem7);
150 gtk_container_add (GTK_CONTAINER (menubar1), menuitem7);
152 menu7 = gtk_menu_new ();
153 gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem7), menu7);
155 about1 = gtk_menu_item_new_with_mnemonic (
_(
"_About"));
156 gtk_widget_show (about1);
157 gtk_container_add (GTK_CONTAINER (menu7), about1);
159 hpaned1 = gtk_hpaned_new ();
160 gtk_widget_show (hpaned1);
161 gtk_box_pack_start (GTK_BOX (vbox1), hpaned1,
TRUE,
TRUE, 0);
162 gtk_paned_set_position (GTK_PANED (hpaned1), 0);
164 vbox2 = gtk_vbox_new (
FALSE, 0);
165 gtk_widget_show (vbox2);
166 gtk_paned_pack1 (GTK_PANED (hpaned1), vbox2,
TRUE,
TRUE);
168 hbox2 = gtk_hbox_new (
FALSE, 0);
169 gtk_widget_show (hbox2);
170 gtk_box_pack_start (GTK_BOX (vbox2), hbox2,
FALSE,
FALSE, 0);
172 drawingarea2 = gtk_drawing_area_new ();
173 gtk_widget_show (drawingarea2);
174 gtk_box_pack_start (GTK_BOX (hbox2), drawingarea2,
FALSE,
FALSE, 1);
175 gtk_widget_set_size_request (drawingarea2, 100, 100);
177 scrolledwindow3 = gtk_scrolled_window_new (
NULL,
NULL);
178 gtk_widget_show (scrolledwindow3);
179 gtk_box_pack_end (GTK_BOX (hbox2), scrolledwindow3,
TRUE,
TRUE, 1);
180 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
181 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN);
183 treeview1 = gtk_tree_view_new ();
184 gtk_widget_show (treeview1);
185 gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview1);
186 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1),
FALSE);
188 toolbar1 = gtk_toolbar_new ();
189 gtk_widget_show (toolbar1);
190 gtk_box_pack_start (GTK_BOX (vbox2), toolbar1,
FALSE,
FALSE, 0);
191 gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_ICONS);
192 tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
194 toolitem1 = (GtkWidget*) gtk_tool_item_new ();
195 gtk_widget_show (toolitem1);
196 gtk_container_add (GTK_CONTAINER (toolbar1), toolitem1);
198 label1 = gtk_label_new (
_(
"type - name"));
199 gtk_widget_show (label1);
200 gtk_container_add (GTK_CONTAINER (toolitem1), label1);
202 toolitem2 = (GtkWidget*) gtk_tool_item_new ();
203 gtk_widget_show (toolitem2);
204 gtk_tool_item_set_expand (GTK_TOOL_ITEM (toolitem2),
TRUE);
205 gtk_container_add (GTK_CONTAINER (toolbar1), toolitem2);
207 label2 = gtk_label_new (
"");
208 gtk_widget_show (label2);
209 gtk_container_add (GTK_CONTAINER (toolitem2), label2);
211 toolitem3 = (GtkWidget*) gtk_tool_item_new ();
212 gtk_widget_show (toolitem3);
213 gtk_container_add (GTK_CONTAINER (toolbar1), toolitem3);
215 button1 = gtk_button_new_with_mnemonic (
_(
"Delete"));
216 gtk_widget_show (button1);
217 gtk_container_add (GTK_CONTAINER (toolitem3), button1);
218 gtk_button_set_focus_on_click (GTK_BUTTON (button1),
FALSE);
220 scrolledwindow4 = gtk_scrolled_window_new (
NULL,
NULL);
221 gtk_widget_show (scrolledwindow4);
222 gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow4,
TRUE,
TRUE, 1);
223 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
224 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN);
226 treeview2 = gtk_tree_view_new ();
227 gtk_widget_show (treeview2);
228 gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview2);
229 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview2),
FALSE);
230 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview2),
TRUE);
232 drawingarea1 = gtk_drawing_area_new ();
233 gtk_widget_show (drawingarea1);
234 gtk_paned_pack2 (GTK_PANED (hpaned1), drawingarea1,
TRUE,
TRUE);
235 gtk_widget_set_size_request (drawingarea1, 300, 300);
236 gtk_widget_set_events (drawingarea1, GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
238 g_signal_connect ((gpointer) window1,
"delete_event",
241 g_signal_connect_swapped ((gpointer) new1,
"activate",
243 GTK_OBJECT (window1));
244 g_signal_connect_swapped ((gpointer) open1,
"activate",
246 GTK_OBJECT (window1));
247 g_signal_connect_swapped ((gpointer) save1,
"activate",
249 GTK_OBJECT (window1));
250 g_signal_connect_swapped ((gpointer) save_as1,
"activate",
252 GTK_OBJECT (window1));
253 g_signal_connect ((gpointer) quit1,
"activate",
256 g_signal_connect ((gpointer) cut1,
"activate",
259 g_signal_connect ((gpointer) copy1,
"activate",
262 g_signal_connect ((gpointer) paste1,
"activate",
265 g_signal_connect ((gpointer) delete1,
"activate",
268 g_signal_connect ((gpointer) about1,
"activate",
271 g_signal_connect ((gpointer) drawingarea2,
"expose_event",
274 g_signal_connect ((gpointer) drawingarea2,
"motion_notify_event",
277 g_signal_connect ((gpointer) button1,
"button_press_event",
280 g_signal_connect ((gpointer) drawingarea1,
"expose_event",
283 g_signal_connect ((gpointer) drawingarea1,
"motion_notify_event",
286 g_signal_connect ((gpointer) drawingarea1,
"configure_event",
289 g_signal_connect ((gpointer) drawingarea1,
"button_press_event",
292 g_signal_connect ((gpointer) drawingarea1,
"button_release_event",
295 g_signal_connect ((gpointer) drawingarea1,
"scroll_event",
339 gtk_window_add_accel_group (GTK_WINDOW (window1), accel_group);
void on_paste1_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean on_button1_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
gboolean on_drawingarea1_button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
#define GLADE_HOOKUP_OBJECT_NO_REF(component, widget, name)
void on_save1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean on_drawingarea1_scroll_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_cut1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_delete1_activate(GtkMenuItem *menuitem, gpointer user_data)
#define GLADE_HOOKUP_OBJECT(component, widget, name)
gboolean on_drawingarea1_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
void on_new1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_copy1_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean on_drawingarea1_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data)
void on_open1_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean on_drawingarea2_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
gboolean on_drawingarea1_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
GtkWidget * create_window1(void)
gboolean on_drawingarea1_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
gboolean on_drawingarea2_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)