diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-19 20:59:56 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-19 20:59:56 (GMT) |
commit | 5f1fc7b0711f51dd05077303f854c658ccd9dcba (patch) | |
tree | 7d519f704a04a8f25d3e5f14ce809a7d985c4581 /Smoke/gtk_streamlines.c | |
parent | a60088999da4f44bf5885f431fe78eb87d643ae7 (diff) | |
download | 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.zip 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.tar.gz 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.tar.bz2 |
Loads of splitting, gui templates added for other elements
Diffstat (limited to 'Smoke/gtk_streamlines.c')
-rw-r--r-- | Smoke/gtk_streamlines.c | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/Smoke/gtk_streamlines.c b/Smoke/gtk_streamlines.c new file mode 100644 index 0000000..67a6661 --- /dev/null +++ b/Smoke/gtk_streamlines.c @@ -0,0 +1,93 @@ +#include <gtk/gtk.h> + +#include <rfftw.h> +#include "fluids.h" + + +#include "palette.h" +#include "streamlines.h" + +#include "gtk_streamlines.h" + + + +static gboolean select_colormap(GtkComboBox *combo, gpointer data) +{ + streamlines_set_colormap(gtk_combo_box_get_active(combo)); +} + + +static gboolean select_num_colors(GtkRange *adjustment, gpointer data) +{ + streamlines_set_num_colors((int)gtk_range_get_value(adjustment)); +} + + +GtkWidget *create_streamlines_page(void) +{ + /* in reality a page is really just a vbox filled with other widgets + */ + GtkWidget *page; + GtkWidget *frame; + GtkWidget *box; + GtkWidget *label; + GtkWidget *button; + GtkWidget *combo; + GtkAdjustment *color_adjustment; + GtkWidget *color_scale; + GSList *dataset_group; + + page = gtk_vbox_new(FALSE, 0); + + frame = gtk_frame_new("Colors"); + + box = gtk_vbox_new(FALSE, 0); + + + label = gtk_label_new("Colormap"); + + gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0); + gtk_widget_show(label); + + + combo = gtk_combo_box_new_text(); + + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Black & White"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Rainbow"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Bands"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Wilrik"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Oliver"); + + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0); + g_signal_connect(combo, "changed", G_CALLBACK(select_colormap), (gpointer)NULL); + + gtk_box_pack_start(GTK_BOX(box), combo, FALSE, TRUE, 0); + gtk_widget_show(combo); + + + label = gtk_label_new("Number of Colors"); + + gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0); + gtk_widget_show(label); + + + color_adjustment = GTK_ADJUSTMENT(gtk_adjustment_new( + PALETTE_MAXCOLORS, 1, PALETTE_MAXCOLORS +1, 0.5, 5, 1)); + color_scale = gtk_hscale_new(color_adjustment); + gtk_scale_set_digits(GTK_SCALE(color_scale), 0); + g_signal_connect(GTK_RANGE(color_scale), "value-changed", G_CALLBACK(select_num_colors), NULL); + + gtk_box_pack_start(GTK_BOX(box), color_scale, FALSE, TRUE, 0); + gtk_widget_show(color_scale); + + + 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; +} |