From 9ccee8a3fceef43c61094c3bda953cb5b0db4f90 Mon Sep 17 00:00:00 2001 From: BST 1999 Tony Gale Date: Sat, 10 Apr 1999 12:55:24 +0000 Subject: [PATCH] use a scrolled window in the clist example. Minor tutorial fixes. Sat Apr 10 13:52:54 BST 1999 Tony Gale * docs/gtk_tut.sgml, examples/clist.c: use a scrolled window in the clist example. Minor tutorial fixes. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ docs/gtk_tut.sgml | 20 ++++++++++++++------ docs/tutorial/gtk_tut.sgml | 20 ++++++++++++++------ examples/clist/clist.c | 16 ++++++++++++---- 10 files changed, 82 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b9eebfe9dc..5dcd53e382 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Sat Apr 10 13:52:54 BST 1999 Tony Gale + + * docs/gtk_tut.sgml, examples/clist.c: use a + scrolled window in the clist example. Minor + tutorial fixes. + Fri Apr 2 09:19:20 BST 1999 Tony Gale * docs/gtk_tut.sgml: Style check from David King diff --git a/docs/gtk_tut.sgml b/docs/gtk_tut.sgml index b7b7825cb9..a7d5a705d2 100644 --- a/docs/gtk_tut.sgml +++ b/docs/gtk_tut.sgml @@ -11,7 +11,7 @@ Tony Gale , Ian Main -April 1st, 1999 +April 10th, 1999 This is a tutorial on how to use GTK (the GIMP Toolkit) through its C interface. @@ -1221,7 +1221,7 @@ int main( int argc, gtk_widget_show (box2); /* Call our make box function - homogeneous = FALSE, spacing = 0, - * expand = FALSE, fill = FALSE, padding = 0 */ + * expand = TRUE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 0, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); @@ -8388,7 +8388,7 @@ int main( int argc, { GtkWidget *window; GtkWidget *vbox, *hbox; - GtkWidget *clist; + GtkWidget *scrolled_window, *clist; GtkWidget *button_add, *button_clear, *button_hide_show; gchar *titles[2] = { "Ingredients", "Amount" }; @@ -8408,6 +8408,14 @@ int main( int argc, gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); + /* Create a scrolled window to pack the CList widget into */ + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + + gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); + gtk_widget_show (scrolled_window); + /* Create the CList. For this example we use 2 columns */ clist = gtk_clist_new_with_titles( 2, titles); @@ -8427,7 +8435,7 @@ int main( int argc, gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); /* Add the CList widget to the vertical box and show it. */ - gtk_box_pack_start(GTK_BOX(vbox), clist, TRUE, TRUE, 0); + gtk_container_add(GTK_CONTAINER(scrolled_window), clist); gtk_widget_show(clist); /* Create the buttons and add them to the window. See the button @@ -8622,7 +8630,7 @@ struct _GtkTree The perils associated with accessing the selection field directly have already been mentioned. The other important fields of the struct can also be accessed with handy macros or class functions. - -David King for style checking this entire document. +David King for style checking the entire document. And to all of you who commented on and helped refine this document. diff --git a/docs/tutorial/gtk_tut.sgml b/docs/tutorial/gtk_tut.sgml index b7b7825cb9..a7d5a705d2 100644 --- a/docs/tutorial/gtk_tut.sgml +++ b/docs/tutorial/gtk_tut.sgml @@ -11,7 +11,7 @@ Tony Gale , Ian Main -April 1st, 1999 +April 10th, 1999 This is a tutorial on how to use GTK (the GIMP Toolkit) through its C interface. @@ -1221,7 +1221,7 @@ int main( int argc, gtk_widget_show (box2); /* Call our make box function - homogeneous = FALSE, spacing = 0, - * expand = FALSE, fill = FALSE, padding = 0 */ + * expand = TRUE, fill = FALSE, padding = 0 */ box2 = make_box (FALSE, 0, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_widget_show (box2); @@ -8388,7 +8388,7 @@ int main( int argc, { GtkWidget *window; GtkWidget *vbox, *hbox; - GtkWidget *clist; + GtkWidget *scrolled_window, *clist; GtkWidget *button_add, *button_clear, *button_hide_show; gchar *titles[2] = { "Ingredients", "Amount" }; @@ -8408,6 +8408,14 @@ int main( int argc, gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); + /* Create a scrolled window to pack the CList widget into */ + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + + gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); + gtk_widget_show (scrolled_window); + /* Create the CList. For this example we use 2 columns */ clist = gtk_clist_new_with_titles( 2, titles); @@ -8427,7 +8435,7 @@ int main( int argc, gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); /* Add the CList widget to the vertical box and show it. */ - gtk_box_pack_start(GTK_BOX(vbox), clist, TRUE, TRUE, 0); + gtk_container_add(GTK_CONTAINER(scrolled_window), clist); gtk_widget_show(clist); /* Create the buttons and add them to the window. See the button @@ -8622,7 +8630,7 @@ struct _GtkTree The perils associated with accessing the selection field directly have already been mentioned. The other important fields of the struct can also be accessed with handy macros or class functions. - -David King for style checking this entire document. +David King for style checking the entire document. And to all of you who commented on and helped refine this document. diff --git a/examples/clist/clist.c b/examples/clist/clist.c index 41a5dcaa53..9bb4d22a03 100644 --- a/examples/clist/clist.c +++ b/examples/clist/clist.c @@ -83,7 +83,7 @@ int main( int argc, { GtkWidget *window; GtkWidget *vbox, *hbox; - GtkWidget *clist; + GtkWidget *scrolled_window, *clist; GtkWidget *button_add, *button_clear, *button_hide_show; gchar *titles[2] = { "Ingredients", "Amount" }; @@ -103,7 +103,15 @@ int main( int argc, gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(vbox); - /* Create the GtkCList. For this example we use 2 columns */ + /* Create a scrolled window to pack the CList widget into */ + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + + gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); + gtk_widget_show (scrolled_window); + + /* Create the CList. For this example we use 2 columns */ clist = gtk_clist_new_with_titles( 2, titles); /* When a selection is made, we want to know about it. The callback @@ -121,8 +129,8 @@ int main( int argc, */ gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); - /* Add the GtkCList widget to the vertical box and show it. */ - gtk_box_pack_start(GTK_BOX(vbox), clist, TRUE, TRUE, 0); + /* Add the CList widget to the vertical box and show it. */ + gtk_container_add(GTK_CONTAINER(scrolled_window), clist); gtk_widget_show(clist); /* Create the buttons and add them to the window. See the button -- GitLab