Hello,
In Vala, I’m loading a shortcuts.ui
resource with a Gtk.Builder
, then I fetch the Gtk.ShortcutsWindow
by its identifier, set it transient to my Gtk.ApplicationWindow
and call present()
on it. The result is an empty window with a search button. When I type some letters, the filtered shortcuts do appear at last. I expected them to be all shown at startup and not only while i am typing some search query. What’s wrong ?
Here is the beginning of the shortcuts.ui
:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkShortcutsWindow" id="shortcuts-window">
<property name="title" translatable="yes">Keyboard shortcuts</property>
<property name="modal">true</property>
<child>
<object class="GtkShortcutsSection" id="shortcuts-section">
<property name="section-name">Shortcuts</property>
<property name="max-height">12</property>
<property name="visible">true</property>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes">Tasks</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator"><ctrl>S</property>
<property name="title" translatable="yes">Sort completed tasks</property>
</object>
</child>
<child>
... and so on...
The relevant loading part is as follow:
var builder = new Gtk.Builder ();
builder.add_from_resource ("/bar/foo/shortcuts.ui");
var window = builder.get_object ("shortcuts-window") as Gtk.ShortcutsWindow;
window.set_transient_for (this);
window.present ();
After some research on the web, I tested seveal tricks but they did not change anything to this. I’d be grateful for some help :'-) Oh by the way, I’m using Gtk 3.24.