A question about GtkTextTag



Hi, 

I have a question regarding GtkTextTag. Documentation for GtkTextTag
says 

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

However, it seems these are not true. 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

I guess they are also documentation bugs. What do you guys think?

Thanks 
Yong



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]