aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-08-30 21:18:47 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-08-30 21:18:47 -0700
commit5625b31873ae5a76b76b036be18858327a25d8f0 (patch)
tree084cda7b99b3a1bdff01d48dc88e050172e87209
parentd1ae1c48309cd0ac5af96114040407dd51e92c37 (diff)
downloadsubsurface-5625b31873ae5a76b76b036be18858327a25d8f0.tar.gz
Make the dive list scrollable (and put it in a vbox)
This means you can actually see them all, and walk through them. It doesn't make any of this *useful*, but whatever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--main.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/main.c b/main.c
index 1b97930e5..dcafab559 100644
--- a/main.c
+++ b/main.c
@@ -127,6 +127,8 @@ int main(int argc, char **argv)
int i;
GtkWidget *win;
GtkWidget *divelist;
+ GtkWidget *vbox;
+ GtkWidget *scrolled_window;
parse_xml_init();
@@ -148,8 +150,24 @@ int main(int argc, char **argv)
g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(on_destroy), NULL);
g_signal_connect(G_OBJECT(win), "expose-event", G_CALLBACK(on_expose), NULL);
+ /* VBOX for the list of dives */
+ vbox=gtk_vbox_new(FALSE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
+ gtk_container_add(GTK_CONTAINER(win), vbox);
+ gtk_widget_show(vbox);
+
+ /* Scrolled window for the list goes into the vbox.. */
+ scrolled_window=gtk_scrolled_window_new(NULL, NULL);
+ gtk_widget_set_usize(scrolled_window, 250, 350);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_container_add(GTK_CONTAINER(vbox), scrolled_window);
+ gtk_widget_show(scrolled_window);
+
+ /* Create the atual divelist */
divelist = create_dive_list();
- gtk_container_add(GTK_CONTAINER(win), divelist);
+
+ /* .. and connect it to the scrolled window */
+ gtk_container_add(GTK_CONTAINER(scrolled_window), divelist);
gtk_widget_set_app_paintable(win, TRUE);
gtk_widget_show_all(win);