Files
piper/data/window.ui
Jente Hidskes 8d77e4bf6c Window: use GtkTemplate to instantiate from a GtkBuilder template
In C/GTK+, templates allow one to define the UI in .ui files, from which
implementations can be instantiated. This significantly reduces
boilerplate code that creates widgets, sets their desired properties and
connects their signals[1, 2].

For several reasons, this does not work in Python[3]. gi_composites.py[4] is an
implementation in Python that does make this work. It's been used by
several projects for a few months now and none report issues. See the
project's README for more information[5].

Taking these facts into mind, let's experiment for a bit and see how it
can serve Piper.

[1]: https://wiki.gnome.org/HowDoI/CustomWidgets#Templates
[2]: https://blogs.gnome.org/tvb/2013/04/09/announcing-composite-widget-templates/
[3]: https://bugzilla.gnome.org/show_bug.cgi?id=701843
[4]: https://github.com/virtuald/pygi-composite-templates/
[5]: https://github.com/virtuald/pygi-composite-templates/blob/master/README.rst
2017-07-27 09:36:39 +02:00

34 lines
1.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="ApplicationWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_duration">400</property>
<property name="transition_type">slide-left-right</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child type="title">
<object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">stack</property>
</object>
</child>
</object>
</child>
</template>
</interface>