From fa53582fef98fed776f3e4f3b700057fa50e5f56 Mon Sep 17 00:00:00 2001 From: BST 1999 Tony Gale Date: Wed, 11 Aug 1999 12:43:04 +0000 Subject: [PATCH] FAQ Update Wed Aug 11 13:38:26 BST 1999 Tony Gale * docs/gtkfaq.sgml: FAQ Update --- ChangeLog | 4 ++ ChangeLog.pre-2-0 | 4 ++ ChangeLog.pre-2-10 | 4 ++ ChangeLog.pre-2-2 | 4 ++ ChangeLog.pre-2-4 | 4 ++ ChangeLog.pre-2-6 | 4 ++ ChangeLog.pre-2-8 | 4 ++ docs/faq/gtkfaq.sgml | 134 +++++++++++++++++++++++++++++++++++++++---- docs/gtkfaq.sgml | 134 +++++++++++++++++++++++++++++++++++++++---- 9 files changed, 272 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 534de0c09b..60dbfcca7e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Wed Aug 11 13:38:26 BST 1999 Tony Gale + + * docs/gtkfaq.sgml: FAQ Update + 1999-07-25 Tor Lillqvist * README.win32 diff --git a/docs/faq/gtkfaq.sgml b/docs/faq/gtkfaq.sgml index 83f407243d..10fa11581a 100644 --- a/docs/faq/gtkfaq.sgml +++ b/docs/faq/gtkfaq.sgml @@ -9,7 +9,7 @@ Nathan Froyd, Tony Gale, Shawn T. Amundson, Emmanuel Deloget -July 14th 1999 +August 10th 1999 This document is intended to answer questions that are likely to be frequently asked by programmers using GTK+ or people who are just looking at @@ -30,7 +30,7 @@ using GTK+. The FAQ authors want to thank: Havoc Pennington -Eric Mouw +Erik Mouw Owen Taylor Tim Janik Thomas Mailund Jensen @@ -103,10 +103,20 @@ reference material for both GTK and GDK, this FAQ and the GTK Tutorial. In addition, you can find links to HTML versions of these documents -by going to -. +by going to . A packaged version of the GTK Tutorial, +with SGML, HTML, Postscript, DVI and text versions can be found in + +There is also a book available that details programming with GTK+ and +GDK which has been written by Eric Harlow. It is entitled "Developing +Linux Applications with GTK+ and GDK" and is available at all good +book stores. The ISBN is 0-7357-0021-4 + +The example code from Eric's book is available on-line at + Is there a mailing list (or mailing list archive) for GTK+? @@ -125,9 +135,9 @@ email message to with subscribe in the subject.

-A searchable archive of the mailing list can be found at - +An archive of the mailing list can be found at + The gtk-list hasn't had any traffic for days, is it dead? @@ -944,6 +954,35 @@ carefully. Regardless, it's especially not a priority since relatively good workarounds exist. --> + +How to I identifiy a widgets top level window or other ancestor? +

+There are a couple of ways to find the top level parent of a +widget. The easier way is to call the + GtkWidget *widget; + + widget = gtk_widget_get_ancestor(w, GTK_TYPE_WINDOW); + + +Since virtually all the GTK_TYPEs can be used as the second parameter of +this function, you can get any parent widget of a particular +widget. Suppose you have an hbox which contains a vbox, which in turn contains +some other atomic widget (entry, label, etc. To find the master hbox +using the + GtkWidget *hbox; + hbox = gtk_widget_get_ancestor(w, GTK_TYPE_HBOX); + + How do I find out about the selection of a GtkList?

@@ -1055,10 +1094,48 @@ Old versions of GTK+ used to provide the + +I don't want the user of my applications to enter text into a GtkCombo. Any idea? +

+A GtkCombo has an associated entry which can be accessed using the +following expression: + + + GTK_COMBO(combo_widget)->entry + + +If you don't want the user to be able to modify the content of this +entry, you can use the gtk_entry_set_editable() function: + + + void gtk_entry_set_editable(GtkEntry *entry, + gboolean editable); + + +Set the editable parameter to FALSE to disable typing into the entry. + + +How do I catch a combo box change? +

+The entry which is associated to your GtkCombo send a "changed" signal when: + + some text is typed in + the selection of the combo box is changed + + +To catch any combo box change, simply connect your signal handler with + + + gtk_signal_connect(GTK_COMBO(cb)->entry, + "changed", + GTK_SIGNAL_FUNC(my_cb_change_handler), + NULL); + + How do I catch a double click event (in a list widget, for example)?

@@ -1453,6 +1530,38 @@ To disable (or to enable) a widget, use the +How do I use horizontal scrollbars with a GtkText widget? +

+The short answer is that you can't. The current version of the GtkText +widget does not support horizontal scrolling. There is an intention to +completely rewrite the GtkText widget, at which time this limitation +will be removed. + + +How do I change the font of a GtkText widget? +

+There are a couple of ways of doing this. As GTK+ allows the +appearance of applications to be changed at run time using resources +you can use something like the following in the appropriate +file: + + +style "text" +{ + font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" +} + + +Another way to do this is to load a font within your program, and then +use this in the functions for adding text to the text widget. You can +load a font using, for example: + + + GdkFont *font; + font = gdk_font_load("-adobe-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"); + + How do I set the cursor position in a GtkText object?

@@ -1530,7 +1639,7 @@ and the underlying X library really doesn't like this. The right function to use here is @@ -1617,6 +1726,7 @@ and safer to use on multiple platforms. + How do I use color allocation?

One of the nice things about GDK is that it's based on top of Xlib; this is @@ -1784,8 +1894,8 @@ This document is maintained by Nathan Froyd name="<maestrox@geocities.com>">, Tony Gale and -Emmanuel Deloget . +Emmanuel Deloget . This FAQ was created by Shawn T. Amundson who continues to provide support. diff --git a/docs/gtkfaq.sgml b/docs/gtkfaq.sgml index 83f407243d..10fa11581a 100644 --- a/docs/gtkfaq.sgml +++ b/docs/gtkfaq.sgml @@ -9,7 +9,7 @@ Nathan Froyd, Tony Gale, Shawn T. Amundson, Emmanuel Deloget -July 14th 1999 +August 10th 1999 This document is intended to answer questions that are likely to be frequently asked by programmers using GTK+ or people who are just looking at @@ -30,7 +30,7 @@ using GTK+. The FAQ authors want to thank: Havoc Pennington -Eric Mouw +Erik Mouw Owen Taylor Tim Janik Thomas Mailund Jensen @@ -103,10 +103,20 @@ reference material for both GTK and GDK, this FAQ and the GTK Tutorial. In addition, you can find links to HTML versions of these documents -by going to -. +by going to . A packaged version of the GTK Tutorial, +with SGML, HTML, Postscript, DVI and text versions can be found in + +There is also a book available that details programming with GTK+ and +GDK which has been written by Eric Harlow. It is entitled "Developing +Linux Applications with GTK+ and GDK" and is available at all good +book stores. The ISBN is 0-7357-0021-4 + +The example code from Eric's book is available on-line at + Is there a mailing list (or mailing list archive) for GTK+? @@ -125,9 +135,9 @@ email message to with subscribe in the subject.

-A searchable archive of the mailing list can be found at - +An archive of the mailing list can be found at + The gtk-list hasn't had any traffic for days, is it dead? @@ -944,6 +954,35 @@ carefully. Regardless, it's especially not a priority since relatively good workarounds exist. --> + +How to I identifiy a widgets top level window or other ancestor? +

+There are a couple of ways to find the top level parent of a +widget. The easier way is to call the + GtkWidget *widget; + + widget = gtk_widget_get_ancestor(w, GTK_TYPE_WINDOW); + + +Since virtually all the GTK_TYPEs can be used as the second parameter of +this function, you can get any parent widget of a particular +widget. Suppose you have an hbox which contains a vbox, which in turn contains +some other atomic widget (entry, label, etc. To find the master hbox +using the + GtkWidget *hbox; + hbox = gtk_widget_get_ancestor(w, GTK_TYPE_HBOX); + + How do I find out about the selection of a GtkList?

@@ -1055,10 +1094,48 @@ Old versions of GTK+ used to provide the + +I don't want the user of my applications to enter text into a GtkCombo. Any idea? +

+A GtkCombo has an associated entry which can be accessed using the +following expression: + + + GTK_COMBO(combo_widget)->entry + + +If you don't want the user to be able to modify the content of this +entry, you can use the gtk_entry_set_editable() function: + + + void gtk_entry_set_editable(GtkEntry *entry, + gboolean editable); + + +Set the editable parameter to FALSE to disable typing into the entry. + + +How do I catch a combo box change? +

+The entry which is associated to your GtkCombo send a "changed" signal when: + + some text is typed in + the selection of the combo box is changed + + +To catch any combo box change, simply connect your signal handler with + + + gtk_signal_connect(GTK_COMBO(cb)->entry, + "changed", + GTK_SIGNAL_FUNC(my_cb_change_handler), + NULL); + + How do I catch a double click event (in a list widget, for example)?

@@ -1453,6 +1530,38 @@ To disable (or to enable) a widget, use the +How do I use horizontal scrollbars with a GtkText widget? +

+The short answer is that you can't. The current version of the GtkText +widget does not support horizontal scrolling. There is an intention to +completely rewrite the GtkText widget, at which time this limitation +will be removed. + + +How do I change the font of a GtkText widget? +

+There are a couple of ways of doing this. As GTK+ allows the +appearance of applications to be changed at run time using resources +you can use something like the following in the appropriate +file: + + +style "text" +{ + font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" +} + + +Another way to do this is to load a font within your program, and then +use this in the functions for adding text to the text widget. You can +load a font using, for example: + + + GdkFont *font; + font = gdk_font_load("-adobe-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"); + + How do I set the cursor position in a GtkText object?

@@ -1530,7 +1639,7 @@ and the underlying X library really doesn't like this. The right function to use here is @@ -1617,6 +1726,7 @@ and safer to use on multiple platforms. + How do I use color allocation?

One of the nice things about GDK is that it's based on top of Xlib; this is @@ -1784,8 +1894,8 @@ This document is maintained by Nathan Froyd name="<maestrox@geocities.com>">, Tony Gale and -Emmanuel Deloget . +Emmanuel Deloget . This FAQ was created by Shawn T. Amundson who continues to provide support.