X-Git-Url: http://pileus.org/git/?p=aweather;a=blobdiff_plain;f=src%2Fcube.c;h=cf01dafbe4c2056d2479f9be262d446fcec16d75;hp=1a13e05dab66bb2e911481ae6416791769054eca;hb=3ec6b69dcc3bad3fce1a22e3c6b9572d83667fdf;hpb=363fdc98af5b3d47698d33e5eb1528ebf7abdcdc diff --git a/src/cube.c b/src/cube.c index 1a13e05..cf01daf 100644 --- a/src/cube.c +++ b/src/cube.c @@ -5,6 +5,8 @@ #include #include +static GtkWidget *rotate_button; + float boxv[][3] = { { -0.5, -0.5, -0.5 }, { 0.5, -0.5, -0.5 }, @@ -134,6 +136,9 @@ gboolean configure(GtkWidget *da, GdkEventConfigure *event, gpointer user_data) gboolean rotate (gpointer user_data) { + if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rotate_button))) + return TRUE; + GtkWidget *da = GTK_WIDGET (user_data); ang++; @@ -144,8 +149,14 @@ gboolean rotate (gpointer user_data) return TRUE; } -gboolean cube_init(GtkDrawingArea *drawing) +gboolean cube_init(GtkDrawingArea *drawing, GtkNotebook *config) { + /* Add configuration tab */ + GtkWidget *label = gtk_label_new("Cube"); + rotate_button = gtk_toggle_button_new_with_label("Rotate"); + gtk_notebook_append_page(GTK_NOTEBOOK(config), rotate_button, label); + + /* Set up OpenGL Stuff */ g_signal_connect(drawing, "configure-event", G_CALLBACK(configure), NULL); g_signal_connect(drawing, "expose-event", G_CALLBACK(expose), NULL); g_timeout_add(1000/60, rotate, drawing);