After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738111 - GtkListBox should allow for setting "placeholder" via GtkBuildable
GtkListBox should allow for setting "placeholder" via GtkBuildable
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-07 19:30 UTC by Christian Hergert
Modified: 2014-10-12 22:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Hergert 2014-10-07 19:30:09 UTC
It would be convenient to be able to set the placeholder text on a GtkListBox using the <child type="placeholder"> syntax of GtkBuilder.
Comment 1 Matthias Clasen 2014-10-12 11:34:11 UTC
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
Comment 2 Tristan Van Berkom 2014-10-12 11:40:53 UTC
(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.
Comment 3 Matthias Clasen 2014-10-12 21:11:14 UTC
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">