GNOME Bugzilla – Bug 322113
Default value of GtkTextTag's properties are *NOT* the same as documented
Last modified: 2006-01-06 17:55:21 UTC
Documentation bug Section: GtkTextTag The "direction" property "direction" GtkTextDirection : Read / Write Text direction, e.g. right-to-left or left-to-right. Default value: GTK_TEXT_DIR_LTR ------------------------------------------------------------------------ -------- The "editable" property "editable" gboolean : Read / Write Whether the text can be modified by the user. Default value: TRUE ------------------------------------------------------------------------ -------- The "font" property "font" gchararray : Read / Write Font description as a string, e.g. "Sans Italic 12". Default value: NULL ------------------------------------------------------------------------ -------- The "language" property "language" gchararray : Read / Write The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If not set, an appropriate default will be used. Default value: NULL Correct version: The "direction" property "direction" GtkTextDirection : Read / Write Text direction, e.g. right-to-left or left-to-right. Default value: GTK_TEXT_DIR_NONE ------------------------------------------------------------------------ -------- The "editable" property "editable" gboolean : Read / Write Whether the text can be modified by the user. Default value: FALSE ------------------------------------------------------------------------ -------- The "font" property "font" gchararray : Read / Write Font description as a string, e.g. "Sans Italic 12". Default value: "Normal" ------------------------------------------------------------------------ -------- The "language" property "language" gchararray : Read / Write The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If not set, an appropriate default will be used. Default value: "en-us" Other information: Below is the test case and its output. #include <gtk/gtk.h> int main (int argc, char* argv[]) { GtkTextTag *tag; GtkTextDirection direction; gboolean editable; gchararray font; gchararray language; gtk_init (&argc, &argv); tag = gtk_text_tag_new ("foo"); g_object_get(G_OBJECT(tag), "direction", &direction, NULL); if (direction != GTK_TEXT_DIR_LTR) g_printf ("direction = %d, should be %d\n", direction, GTK_TEXT_DIR_LTR); g_object_get(G_OBJECT(tag), "editable", &editable, NULL); if (editable != TRUE) g_printf ("editable = %d, should be %d\n", editable, TRUE); g_object_get(G_OBJECT(tag), "font", &font, NULL); if (font != NULL) g_printf ("font = %s, should be NULL\n", font); g_object_get(G_OBJECT(tag), "language", &language, NULL); if (language != NULL) g_printf ("language = %s, should be NULL\n", language); return 0; } ********** Output ********** direction = 0, should be 1 editable = 0, should be 1 font = Normal, should be NULL language = en-us, should be NULL
BTW, this bug occurs on both GTK+ 2.6 and 2.8.
2006-01-06 Matthias Clasen <mclasen@redhat.com> * gtk/gtktexttag.c (gtk_text_attributes_new): Initialize editable to TRUE. (gtk_text_tag_class_init): The default value for the direction property is GTK_TEXT_DIR_NONE. Add notes about the initial values of the font and language properties.