[Frugalware-darcs] setup: setup-current: gtkize part II

Christian Hamar alias krix krics at linuxforum.hu
Wed Mar 29 23:54:05 CEST 2006


[setup-current: gtkize part II
Christian Hamar alias krix <krics at linuxforum.hu>**20051108132546
   * Added some initial GTK part to setup.
 
] {
hunk ./src/setup.c 108
-int main()
+int main(int argc, char *argv[])
hunk ./src/setup.c 119
+#ifdef GTK
+	fw_init_gtk();
+	gtk_draw_framework();
+#endif
hunk ./src/setup.c 137
+#ifdef GTK
+	gtk_main();
+#endif
+	printf("cleanup\n");
hunk ./src/util.c 25
+#ifdef DIALOG
hunk ./src/util.c 27
+#endif
+#ifdef GTK
+#include <gtk/gtk.h>
+#endif
hunk ./src/util.c 178
+}
+#endif
+
+#ifdef GTK
+void fw_init_gtk(void)
+{
+	gtk_init(NULL, NULL);
+	gtk_set_locale();
+}
+
+void fw_end_gtk(GtkWidget *win)
+{
+	gtk_widget_destroy(win);
+	gtk_main_quit();
+}
+
+void gtk_draw_framework(void)
+{
+	GtkWidget *mainwindow;
+	GtkWidget *hbox, *vbox, *frame;
+	
+	mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	g_signal_connect(G_OBJECT(mainwindow), "destroy", G_CALLBACK(fw_end_gtk), NULL);
+	gtk_widget_show(mainwindow);
hunk ./src/util.h 43
+#ifdef GTK
+void fw_init_gtk(void);
+void fw_end_gtk(GtkWidget *win);
+void gtk_draw_framework(void);
+#endif
}


More information about the Frugalware-darcs mailing list