summaryrefslogtreecommitdiffstats
path: root/Smoke/gtk.c
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2007-12-14 12:24:12 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2007-12-14 12:24:12 (GMT)
commitdbc6530ef4b5a5ce4284b0cb32e2f61677b47b18 (patch)
treea5f54b566e9c4b7fe34edb7ef0a271fa56bb8d2b /Smoke/gtk.c
parent9aaa000d79789033ea531c7d2c140fee1283305c (diff)
download2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.zip
2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.tar.gz
2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.tar.bz2
Diffstat (limited to 'Smoke/gtk.c')
-rw-r--r--Smoke/gtk.c72
1 files changed, 62 insertions, 10 deletions
diff --git a/Smoke/gtk.c b/Smoke/gtk.c
index 724291e..8b8e8c5 100644
--- a/Smoke/gtk.c
+++ b/Smoke/gtk.c
@@ -48,6 +48,8 @@
#include <rfftw.h> //the numerical simulation FFTW library
#include "fluids.h"
+#include "seedpoint.h"
+
/**************************************************************************
* The following section contains all the macro definitions.
@@ -257,18 +259,18 @@ motion_notify_event (GtkWidget *widget,
if (event->state & GDK_BUTTON1_MASK)
{
- g_print (" 1");
+ //g_print (" 1");
drag((int)event->x, (int)event->y);
}
if (event->state & GDK_BUTTON2_MASK)
{
- g_print (" 2");
+ //g_print (" 2");
}
if (event->state & GDK_BUTTON3_MASK)
{
- g_print (" 3");
+ //g_print (" 3");
}
// g_print ("\n");
@@ -313,7 +315,7 @@ button_press_event (GtkWidget *widget,
if (event->button == 1)
{
/*** Fill in the details here. ***/
- g_print ("button 1\n");
+ //g_print ("button 1\n");
// fluids
click(1, (event->type == GDK_BUTTON_PRESS) ? 0 : 1, (int)event->x, (int)event->y);
// endf
@@ -324,12 +326,12 @@ button_press_event (GtkWidget *widget,
if (event->button == 2)
{
/*** Fill in the details here. ***/
- g_print ("button 2\n");
+ //g_print ("button 2\n");
return TRUE;
}
- g_print ("\n");
+ //g_print ("\n");
return FALSE;
}
@@ -340,11 +342,11 @@ button_press_event_popup_menu (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
- g_print ("%s: \"button_press_event_popup\": ", gtk_widget_get_name (widget));
+ //g_print ("%s: \"button_press_event_popup\": ", gtk_widget_get_name (widget));
if (event->button == 3)
{
- g_print ("button 3\n");
+ //g_print ("button 3\n");
/* Popup menu. */
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL,
@@ -352,7 +354,7 @@ button_press_event_popup_menu (GtkWidget *widget,
return TRUE;
}
- g_print ("\n");
+ //g_print ("\n");
return FALSE;
}
@@ -409,7 +411,7 @@ key_press_event (GtkWidget *widget,
break;
case GDK_m:
- scalar_col++; if (scalar_col>COLOR_OLIVER) scalar_col=COLOR_BLACKWHITE;
+ scalar_col++; if (scalar_col > COLOR_OLIVER) scalar_col = COLOR_BLACKWHITE;
break;
case GDK_a:
@@ -851,6 +853,47 @@ GtkWidget *create_height_plots_page(void)
return page;
}
+GtkWidget *create_stream_tubes_page(void)
+{
+ int i, max;
+ GtkWidget *page;
+ GtkWidget *frame;
+ GtkWidget *box;
+ GtkWidget *button;
+ GtkWidget *combo;
+ GList *glist;
+
+ glist = NULL;
+
+ page = gtk_vbox_new(FALSE, 0);
+
+ frame = gtk_frame_new("Seed points");
+
+ box = gtk_hbox_new(FALSE, 0);
+
+ combo = gtk_combo_new();
+
+ max = get_cur_seedpoint();
+ for (i = 0; i < max; i++)
+ {
+ glist = g_list_append(glist, strcat("Seedpoint ", (char *)i));
+ }
+
+ gtk_combo_set_popdown_strings (GTK_COMBO (combo), glist);
+
+ gtk_box_pack_start(GTK_BOX(box), combo, FALSE, TRUE, 0);
+ gtk_widget_show(combo);
+
+ gtk_container_add(GTK_CONTAINER(frame), box);
+ gtk_widget_show(box);
+
+ gtk_box_pack_start(GTK_BOX(page), frame, FALSE, TRUE, 0);
+
+ gtk_widget_show(frame);
+
+ return page;
+}
+
/***
*** Creates the simple application window with one
*** drawing area that has an OpenGL-capable visual.
@@ -1031,6 +1074,15 @@ create_window (GdkGLConfig *glconfig)
gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label);
+ notebook_page_label = gtk_label_new("Stream tubes");
+ gtk_widget_show(notebook_page_label);
+
+ notebook_page = create_stream_tubes_page();
+ gtk_container_add(GTK_CONTAINER(window), notebook_page);
+ gtk_widget_show(notebook_page);
+
+ gtk_notebook_append_page(settings_notebook, notebook_page, notebook_page_label);
+
return window;
}