Commit 9ccee8a3 authored by BST 1999  Tony Gale's avatar BST 1999 Tony Gale Committed by Tony Gale

use a scrolled window in the clist example. Minor tutorial fixes.

Sat Apr 10 13:52:54 BST 1999  Tony Gale <gale@gtk.org>

        * docs/gtk_tut.sgml, examples/clist.c: use a
          scrolled window in the clist example. Minor
          tutorial fixes.
parent 42e38e41
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
Sat Apr 10 13:52:54 BST 1999 Tony Gale <gale@gtk.org>
* 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 <gale@gtk.org> Fri Apr 2 09:19:20 BST 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Style check from David King * docs/gtk_tut.sgml: Style check from David King
......
...@@ -11,7 +11,7 @@ Tony Gale <tt><htmlurl url="mailto:gale@gtk.org" ...@@ -11,7 +11,7 @@ Tony Gale <tt><htmlurl url="mailto:gale@gtk.org"
name="&lt;gale@gtk.org&gt;"></tt>, name="&lt;gale@gtk.org&gt;"></tt>,
Ian Main <tt><htmlurl url="mailto:imain@gtk.org" Ian Main <tt><htmlurl url="mailto:imain@gtk.org"
name="&lt;imain@gtk.org&gt;"></tt> name="&lt;imain@gtk.org&gt;"></tt>
<date>April 1st, 1999 <date>April 10th, 1999
<abstract> <abstract>
This is a tutorial on how to use GTK (the GIMP Toolkit) through its C This is a tutorial on how to use GTK (the GIMP Toolkit) through its C
interface. interface.
...@@ -1221,7 +1221,7 @@ int main( int argc, ...@@ -1221,7 +1221,7 @@ int main( int argc,
gtk_widget_show (box2); gtk_widget_show (box2);
/* Call our make box function - homogeneous = FALSE, spacing = 0, /* 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); box2 = make_box (FALSE, 0, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
gtk_widget_show (box2); gtk_widget_show (box2);
...@@ -8388,7 +8388,7 @@ int main( int argc, ...@@ -8388,7 +8388,7 @@ int main( int argc,
{ {
GtkWidget *window; GtkWidget *window;
GtkWidget *vbox, *hbox; GtkWidget *vbox, *hbox;
GtkWidget *clist; GtkWidget *scrolled_window, *clist;
GtkWidget *button_add, *button_clear, *button_hide_show; GtkWidget *button_add, *button_clear, *button_hide_show;
gchar *titles[2] = { "Ingredients", "Amount" }; gchar *titles[2] = { "Ingredients", "Amount" };
...@@ -8408,6 +8408,14 @@ int main( int argc, ...@@ -8408,6 +8408,14 @@ int main( int argc,
gtk_container_add(GTK_CONTAINER(window), vbox); gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(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 */ /* Create the CList. For this example we use 2 columns */
clist = gtk_clist_new_with_titles( 2, titles); clist = gtk_clist_new_with_titles( 2, titles);
...@@ -8427,7 +8435,7 @@ int main( int argc, ...@@ -8427,7 +8435,7 @@ int main( int argc,
gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150);
/* Add the CList widget to the vertical box and show it. */ /* 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); gtk_widget_show(clist);
/* Create the buttons and add them to the window. See the button /* Create the buttons and add them to the window. See the button
...@@ -8622,7 +8630,7 @@ struct _GtkTree ...@@ -8622,7 +8630,7 @@ struct _GtkTree
The perils associated with accessing the <tt>selection</tt> field The perils associated with accessing the <tt>selection</tt> field
directly have already been mentioned. The other important fields of directly have already been mentioned. The other important fields of
the struct can also be accessed with handy macros or class functions. the struct can also be accessed with handy macros or class functions.
<tt/GTK_TREE_IS_ROOT_TREE (Tree)/ returns a boolean value which <tt/GTK_IS_ROOT_TREE (Tree)/ returns a boolean value which
indicates whether a tree is the root tree in a Tree hierarchy, while indicates whether a tree is the root tree in a Tree hierarchy, while
<tt/GTK_TREE_ROOT_TREE (Tree)/ returns the root tree, an object of <tt/GTK_TREE_ROOT_TREE (Tree)/ returns the root tree, an object of
type GtkTree (so, remember to cast it using <tt/GTK_WIDGET (Tree)/ if type GtkTree (so, remember to cast it using <tt/GTK_WIDGET (Tree)/ if
...@@ -14452,7 +14460,7 @@ and various tutorial fixups and improvements. ...@@ -14452,7 +14460,7 @@ and various tutorial fixups and improvements.
The GLib text was in turn based on material developed by Damon Chaplin The GLib text was in turn based on material developed by Damon Chaplin
<tt><htmlurl url="mailto:DAChaplin@msn.com" name="DAChaplin@msn.com"></tt> <tt><htmlurl url="mailto:DAChaplin@msn.com" name="DAChaplin@msn.com"></tt>
<item>David King for style checking this entire document. <item>David King for style checking the entire document.
</itemize> </itemize>
And to all of you who commented on and helped refine this document. And to all of you who commented on and helped refine this document.
......
...@@ -11,7 +11,7 @@ Tony Gale <tt><htmlurl url="mailto:gale@gtk.org" ...@@ -11,7 +11,7 @@ Tony Gale <tt><htmlurl url="mailto:gale@gtk.org"
name="&lt;gale@gtk.org&gt;"></tt>, name="&lt;gale@gtk.org&gt;"></tt>,
Ian Main <tt><htmlurl url="mailto:imain@gtk.org" Ian Main <tt><htmlurl url="mailto:imain@gtk.org"
name="&lt;imain@gtk.org&gt;"></tt> name="&lt;imain@gtk.org&gt;"></tt>
<date>April 1st, 1999 <date>April 10th, 1999
<abstract> <abstract>
This is a tutorial on how to use GTK (the GIMP Toolkit) through its C This is a tutorial on how to use GTK (the GIMP Toolkit) through its C
interface. interface.
...@@ -1221,7 +1221,7 @@ int main( int argc, ...@@ -1221,7 +1221,7 @@ int main( int argc,
gtk_widget_show (box2); gtk_widget_show (box2);
/* Call our make box function - homogeneous = FALSE, spacing = 0, /* 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); box2 = make_box (FALSE, 0, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
gtk_widget_show (box2); gtk_widget_show (box2);
...@@ -8388,7 +8388,7 @@ int main( int argc, ...@@ -8388,7 +8388,7 @@ int main( int argc,
{ {
GtkWidget *window; GtkWidget *window;
GtkWidget *vbox, *hbox; GtkWidget *vbox, *hbox;
GtkWidget *clist; GtkWidget *scrolled_window, *clist;
GtkWidget *button_add, *button_clear, *button_hide_show; GtkWidget *button_add, *button_clear, *button_hide_show;
gchar *titles[2] = { "Ingredients", "Amount" }; gchar *titles[2] = { "Ingredients", "Amount" };
...@@ -8408,6 +8408,14 @@ int main( int argc, ...@@ -8408,6 +8408,14 @@ int main( int argc,
gtk_container_add(GTK_CONTAINER(window), vbox); gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(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 */ /* Create the CList. For this example we use 2 columns */
clist = gtk_clist_new_with_titles( 2, titles); clist = gtk_clist_new_with_titles( 2, titles);
...@@ -8427,7 +8435,7 @@ int main( int argc, ...@@ -8427,7 +8435,7 @@ int main( int argc,
gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150);
/* Add the CList widget to the vertical box and show it. */ /* 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); gtk_widget_show(clist);
/* Create the buttons and add them to the window. See the button /* Create the buttons and add them to the window. See the button
...@@ -8622,7 +8630,7 @@ struct _GtkTree ...@@ -8622,7 +8630,7 @@ struct _GtkTree
The perils associated with accessing the <tt>selection</tt> field The perils associated with accessing the <tt>selection</tt> field
directly have already been mentioned. The other important fields of directly have already been mentioned. The other important fields of
the struct can also be accessed with handy macros or class functions. the struct can also be accessed with handy macros or class functions.
<tt/GTK_TREE_IS_ROOT_TREE (Tree)/ returns a boolean value which <tt/GTK_IS_ROOT_TREE (Tree)/ returns a boolean value which
indicates whether a tree is the root tree in a Tree hierarchy, while indicates whether a tree is the root tree in a Tree hierarchy, while
<tt/GTK_TREE_ROOT_TREE (Tree)/ returns the root tree, an object of <tt/GTK_TREE_ROOT_TREE (Tree)/ returns the root tree, an object of
type GtkTree (so, remember to cast it using <tt/GTK_WIDGET (Tree)/ if type GtkTree (so, remember to cast it using <tt/GTK_WIDGET (Tree)/ if
...@@ -14452,7 +14460,7 @@ and various tutorial fixups and improvements. ...@@ -14452,7 +14460,7 @@ and various tutorial fixups and improvements.
The GLib text was in turn based on material developed by Damon Chaplin The GLib text was in turn based on material developed by Damon Chaplin
<tt><htmlurl url="mailto:DAChaplin@msn.com" name="DAChaplin@msn.com"></tt> <tt><htmlurl url="mailto:DAChaplin@msn.com" name="DAChaplin@msn.com"></tt>
<item>David King for style checking this entire document. <item>David King for style checking the entire document.
</itemize> </itemize>
And to all of you who commented on and helped refine this document. And to all of you who commented on and helped refine this document.
......
...@@ -83,7 +83,7 @@ int main( int argc, ...@@ -83,7 +83,7 @@ int main( int argc,
{ {
GtkWidget *window; GtkWidget *window;
GtkWidget *vbox, *hbox; GtkWidget *vbox, *hbox;
GtkWidget *clist; GtkWidget *scrolled_window, *clist;
GtkWidget *button_add, *button_clear, *button_hide_show; GtkWidget *button_add, *button_clear, *button_hide_show;
gchar *titles[2] = { "Ingredients", "Amount" }; gchar *titles[2] = { "Ingredients", "Amount" };
...@@ -103,7 +103,15 @@ int main( int argc, ...@@ -103,7 +103,15 @@ int main( int argc,
gtk_container_add(GTK_CONTAINER(window), vbox); gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(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); clist = gtk_clist_new_with_titles( 2, titles);
/* When a selection is made, we want to know about it. The callback /* When a selection is made, we want to know about it. The callback
...@@ -121,8 +129,8 @@ int main( int argc, ...@@ -121,8 +129,8 @@ int main( int argc,
*/ */
gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150); gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150);
/* Add the GtkCList widget to the vertical box and show it. */ /* 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); gtk_widget_show(clist);
/* Create the buttons and add them to the window. See the button /* Create the buttons and add them to the window. See the button
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment