From 46c20d816ed8db6c9a49cb0ff0ff521c37633afa Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Fri, 22 Jun 2012 20:48:25 +0000 Subject: Bon, l'IHM est faite. Le about dialog marche, la licence GPL3 est là, etc. Par contre les toggle butons ne sont pas mutuellement exclusif (et j'ai tenté de bricoler et ça chie) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-violon-leds/trunk@26 6be1fa4d-33ac-4c33-becc-79fcb3794bb6 --- tests/test7/test7.c | 92 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 67 insertions(+), 25 deletions(-) (limited to 'tests/test7/test7.c') diff --git a/tests/test7/test7.c b/tests/test7/test7.c index 7a3ca63..158ead2 100644 --- a/tests/test7/test7.c +++ b/tests/test7/test7.c @@ -1,46 +1,88 @@ -/* - First run tutorial.glade through gtk-builder-convert with this command: - gtk-builder-convert tutorial.glade tutorial.xml - - Then save this file as main.c and compile it using this command - (those are backticks, not single quotes): - gcc -Wall -g -o tutorial main.c `pkg-config --cflags --libs gtk+-2.0` -export-dynamic - - Then execute it using: - ./tutorial - */ #include #include -void on_win_main_destroy (GtkObject *object, gpointer user_data) { +#define FUNC_COUNT 4 + +GtkBuilder *builder=NULL; +GtkToggleButton *buttons[FUNC_COUNT]={NULL}; + +void on_win_main_destroy(GtkObject *object, gpointer user_data) { gtk_main_quit(); } +void on_mi_about_activate(GtkObject *object, gpointer user_data) { + GtkDialog *dialog; + + g_return_if_fail(builder!=NULL); + + dialog = GTK_DIALOG(gtk_builder_get_object(builder, "win_about")); + g_return_if_fail(dialog!=NULL); + + g_signal_connect_swapped (dialog, "response", G_CALLBACK(gtk_widget_destroy), dialog); + gtk_widget_show_all(GTK_WIDGET(dialog)); +} + +void switch_to_func(gint func_id) { + gint i; + // Toggle off all buttons but the active one + for (i=0;i