如何在 GTK+ 中执行 in-window 提示
How to do in-window hint in GTK+
GNOME 的录音机应用程序在启动时有这个 in-window 提示。 我该怎么做?我正在浏览源代码,发现它是用 Vala 或 Javascript(不确定)编写的。另外,我想将提示放在 GtkListBox 中(录音机也在列表框中)。我将如何在 GTK+ 的 C 绑定中执行此操作?
根据their repo (I searched the hint string in there), they are using GtkStack
widget with GtkStackPage
s:
<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 <b>Record</b> button to make sound recordings</property>
</object>
</property>
</object>
</child>
似乎 GtkStack
可用于 GTK3,但 GtkStackPage
不可用(仅限 Gtk4)。
GNOME 的录音机应用程序在启动时有这个 in-window 提示。
根据their repo (I searched the hint string in there), they are using GtkStack
widget with GtkStackPage
s:
<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 <b>Record</b> button to make sound recordings</property>
</object>
</property>
</object>
</child>
似乎 GtkStack
可用于 GTK3,但 GtkStackPage
不可用(仅限 Gtk4)。