ADBeveridge
ADBeveridge

Reputation: 682

How to do in-window hint in GTK+

The Sound Recorder app of GNOME has this in-window hint at start-up. Sound Recorder Screeshot How do I do this? I was browsing through the source code and found that it is written either in Vala or Javascript (not sure). Also, I want to put the hint inside the GtkListBox (Sound Recorder's is inside a list box too). How would I go about doing this in the C binding of GTK+?

Upvotes: 1

Views: 117

Answers (1)

BobMorane
BobMorane

Reputation: 4296

According to their repo (I searched the hint string in there), they are using GtkStack widget with GtkStackPages:

<object class="AdwToastOverlay" id="toastOverlay">
  <property name="child">
    <object class="GtkStack" id="mainStack">
      <property name="hexpand">True</property>
      <property name="vexpand">True</property>
      <child>
        <object class="GtkStackPage">
          <property name="name">empty</property>
          <property name="child">
            <object class="AdwStatusPage" id="emptyPage">
              <property name="title" translatable="yes">Add Recordings</property>
              <property name="description" translatable="yes">Use the &lt;b&gt;Record&lt;/b&gt; button to make sound recordings</property>
            </object>
          </property>
        </object>
      </child>

It seems that GtkStack was available with GTK3, but not GtkStackPage (Gtk4 only).

Upvotes: 1

Related Questions