From b6608fec78fde143b1f72764a0cee5846ad05a77 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 29 Oct 2004 21:03:52 +0000 Subject: [PATCH] Move the "tail" question to the text view section. Add an entry for "why MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2004-10-29 Matthias Clasen * gtk/question_index.sgml: Move the "tail" question to the text view section. Add an entry for "why are my types not registered". (#156809, Q by Salvador Fandiño, A by Owen Taylor) --- docs/reference/ChangeLog | 7 ++++ docs/reference/gtk/question_index.sgml | 57 ++++++++++++++++++-------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 3db3487155..904265e013 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,10 @@ +2004-10-29 Matthias Clasen + + * gtk/question_index.sgml: Move the "tail" question to the + text view section. + Add an entry for "why are my types not registered". (#156809, + Q by Salvador Fandiño, A by Owen Taylor) + 2004-10-27 Matthias Clasen * === Released 2.5.4 === diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index 29296c4002..931ec61a32 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -483,31 +483,25 @@ to the GNOME 2.0 platform. -How do I make a text view scroll to the end of the buffer automatically ? +Why are types not registered if I use their GTK_TYPE_BLAH; macro ? -The "insert" mark marks the insertion point -where gtk_text_buffer_insert() -inserts new text into the buffer. The text is inserted -before the "insert" mark, so that it generally stays -at the end of the buffer. If it gets explicitly moved to some other position, -e.g. when the user selects some text, -use gtk_text_buffer_move_mark() -to set it to the desired location before inserting more text. -The "insert" mark of a buffer can be obtained with gtk_text_buffer_get_insert(). +The GTK_TYPE_BLAH macros are defined as calls to +gtk_blah_get_type(), and the _get_type() functions +are declared as G_GNUC_CONST which allows the compiler to optimize +the call away if it appears that the value is not being used. - -To ensure that the end of the buffer remains visible, use -gtk_text_view_scroll_to_mark() to scroll to the "insert" mark after inserting new text. + +A common workaround for this problem is to store the result in a volatile variable, +which keeps the compiler from optimizing the call away. + +volatile GType dummy = GTK_TYPE_BLAH; + - - Which widget should I use... @@ -732,6 +726,35 @@ To ensure that all text has the desired appearance, use gtk_widget_modify_font() to change the default font for the widget. + + + + +How do I make a text view scroll to the end of the buffer automatically ? + + + + + +The "insert" mark marks the insertion point +where gtk_text_buffer_insert() +inserts new text into the buffer. The text is inserted +before the "insert" mark, so that it generally stays +at the end of the buffer. If it gets explicitly moved to some other position, +e.g. when the user selects some text, +use gtk_text_buffer_move_mark() +to set it to the desired location before inserting more text. +The "insert" mark of a buffer can be obtained with gtk_text_buffer_get_insert(). + + + +To ensure that the end of the buffer remains visible, use +gtk_text_view_scroll_to_mark() to scroll to the "insert" mark after inserting new text. + + +