GNOME Bugzilla – Bug 738111
GtkListBox should allow for setting "placeholder" via GtkBuildable
Last modified: 2014-10-12 22:55:36 UTC
It would be convenient to be able to set the placeholder text on a GtkListBox using the <child type="placeholder"> syntax of GtkBuilder.
I don't think GTK+ does anything for placeholders. gtkbuilderparser.c has this: ... else if (strcmp (element_name, "child") == 0) parse_child (data, element_name, names, values, error); ... else if (strcmp (element_name, "placeholder") == 0) { /* placeholder has no special treatmeant, but it needs an * if clause to avoid an error below. */ } if anything, glade needs to do something here
(In reply to comment #1) > I don't think GTK+ does anything for placeholders. gtkbuilderparser.c has this: > I have a feeling Christian is referring to placeholder text, as in the text one would see in a GtkEntry when no text is present. However, I'm not sure that doing such a feature is good for listbox as is implies some highly specific usages of listbox (i.e. I think it's overspecializing for what should be a basic GTK+ building block). In the past I've often added an editable row to treeviews with some italic gray text such as " < Enter a foo > " to serve a similar purpose as what I think Christian is suggesting.
As Christian just clarified, this is about the existing function gtk_list_box_set_placeholder This functionality is not currently available in GtkBuilder - could be done as <child type="placeholder">