Search code examples
c++cgtk2

gtk_text_buffer_create_tag creates warning: 'GtkTextTag' has no property named '\u0004'


When I call

gtk_text_buffer_create_tag(buffer, "small_distance", "foreground", "green");  

in my program it warns at runtime: g_object_set_is_valid_property: object class 'GtkTextTag' has no property named '\u0004'


Solution

  • You have to "NULL-terminate" the list of args:

    gtk_text_buffer_create_tag(buffer, "small_distance", 
                               "foreground", "green", 
                               NULL); 
    

    Notice the NULL as "last parameter".

    More on this topic:

    The param list is treated as g_object_set() . And it states

    value for the first property, followed optionally by more name/value pairs, followed by NULL