From 3f17a1113721ce8bd85681eb55be39b4ad1eefbd Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 5 Nov 2000 16:09:04 +0000 Subject: [PATCH] documented some of the object args 2000-11-05 Havoc Pennington * gtk/tmpl/gtktexttag.sgml: documented some of the object args * gtk/text_widget.sgml: fixups --- docs/reference/ChangeLog | 6 +++ docs/reference/gtk/text_widget.sgml | 21 ++++---- docs/reference/gtk/tmpl/gtk-unused.sgml | 24 ++++----- docs/reference/gtk/tmpl/gtktexttag.sgml | 69 ++++++++++++++----------- 4 files changed, 69 insertions(+), 51 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 12b5a9c427..a6949f8773 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +2000-11-05 Havoc Pennington + + * gtk/tmpl/gtktexttag.sgml: documented some of the object args + + * gtk/text_widget.sgml: fixups + 2000-11-04 Havoc Pennington * gtk/gtk-sections.txt: Added a bunch of stuff from unused diff --git a/docs/reference/gtk/text_widget.sgml b/docs/reference/gtk/text_widget.sgml index 80cd81d2e6..47ef788f5f 100644 --- a/docs/reference/gtk/text_widget.sgml +++ b/docs/reference/gtk/text_widget.sgml @@ -36,7 +36,7 @@ Text in a buffer can be marked with tags. A tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text inside the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead -affect change the behavior of mouse and key presses, "lock" a range of text so +affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things. A tag is represented by a GtkTextTag object. One GtkTextTag can be applied to any number of text @@ -112,24 +112,25 @@ between the old and new positions). The simplest usage of GtkTextView might look like this: + GtkWidget *view; + GtkTextBuffer *buffer; - /* Get a buffer (it's a GObject, not a GtkObject, so we own a reference - * after this). Passing NULL as argument causes an empty tag table to be - * automatically created. - */ + view = gtk_text_view_new (); - buffer = gtk_text_buffer_new (NULL); + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); - view = gtk_text_view_new_with_buffer (buffer); - - /* view holds a reference now */ - g_object_unref (G_OBJECT (buffer)); + gtk_text_buffer_set_text (buffer, "Hello, this is some text"); /* Now you might put the view in a container and display it on the * screen; when the user edits the text, signals on the buffer * will be emitted, such as "changed", "insert_text", and so on. */ +In many cases it's also convenient to first create the buffer with +gtk_text_buffer_new(), then create a widget for that buffer with +gtk_text_view_new_with_buffer(). Or you can change the buffer the +widget displays after the widget is created with +gtk_text_view_set_buffer(). diff --git a/docs/reference/gtk/tmpl/gtk-unused.sgml b/docs/reference/gtk/tmpl/gtk-unused.sgml index c71e6595b0..f4234a59cc 100644 --- a/docs/reference/gtk/tmpl/gtk-unused.sgml +++ b/docs/reference/gtk/tmpl/gtk-unused.sgml @@ -541,14 +541,6 @@ The first "flat" (no struct) enumerated type value. @func_data: @args: - - - - - -@wid: -@flag: - @@ -557,6 +549,14 @@ The first "flat" (no struct) enumerated type value. @window: @focus: + + + + + +@wid: +@flag: + @@ -799,6 +799,10 @@ The pointer is allocated just for you: you must g_free() it. @func_data: @args: + + + + @@ -807,10 +811,6 @@ The pointer is allocated just for you: you must g_free() it. @mark: @Returns: - - - - diff --git a/docs/reference/gtk/tmpl/gtktexttag.sgml b/docs/reference/gtk/tmpl/gtktexttag.sgml index c15c14299e..01e74955c1 100644 --- a/docs/reference/gtk/tmpl/gtktexttag.sgml +++ b/docs/reference/gtk/tmpl/gtktexttag.sgml @@ -41,12 +41,12 @@ types related to the text widget and how they work together. - +Describes a type of line wrapping. -@GTK_WRAPMODE_NONE: -@GTK_WRAPMODE_CHAR: -@GTK_WRAPMODE_WORD: +@GTK_WRAPMODE_NONE: don't wrap lines; just use scrollbars +@GTK_WRAPMODE_CHAR: allow line breaks between any two characters +@GTK_WRAPMODE_WORD: allow line breaks only between words @@ -176,127 +176,138 @@ types related to the text widget and how they work together. - +Name of the tag, or NULL for anonymous tags. Can only be set +when the tag is created. - +Background color, as a string such as "red" or "#FFFFFF" - +Background color, as a #GdkColor. - +Whether to make the background color for each character the height of +the highest font used on the current line, or the height of the font +used for the current character. - +A #GdkBitmap to use for stippling the background color. - +The #GtkTextDirection for the tagged text. - +Whether the user can modify the tagged text. - +Font as a Pango font name, e.g. "Sans Italic 12" - +Font as a #PangoFontDescription. - +Foreground color as a string such as "red" or "#FFFFFF". - +Foreground color as a #GdkColor. - +A #GdkBitmap to use as a stipple pattern for the foreground. - +A #GtkJustification for the text. This is only used when the tag is +applied to the first character in a paragraph. - +The language this text is in, as an ISO code. Pango can use this as a +hint when rendering the text. If you don't understand this argument, +you probably don't need it. - +Pixel width of left margin of the text. - +Pixel width of the left margin of the text for lines after the first +line in a wrapped paragraph. - +Pixels to offset the text horizontally or vertically, useful to +produce superscript and subscript. - +Pixels of blank space to leave above each newline-terminated line. - +Pixels of blank space to leave below each newline-terminated line. - +Pixels of blank space to leave between wrapped lines inside the same +newline-terminated line (paragraph). - +Pixel width of right margin. - +%TRUE to draw a line through the text. - +A #PangoUnderline value. - +A #GtkWrapMode value. Only used if the tag applies to the first +character in a paragraph. - +A #PangoTabArray indicating tabs for this text. Only used if the tag +applies to the first character in a paragraph.