Python: GtkMenuItem packing with GtkBox and 2 labels

124 views Asked by At

I'm using Gtk.Builder() to build an AppIndicator's menu. The goal is to have a MenuItem with two labels inside it (one on the left and one on the right), but for some reason, the second label gets ignored and only the first one is rendered correctly. I'm pretty certain its possible, because Gnome documentation says so and DateTime widget on Ubuntu have the same kind of MenuItem in it.

<interface>
    <requires lib="gtk+" version="3.12"/>
    <!-- interface-naming-policy project-wide -->
    <object class="GtkMenu">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <child>
            <object class="GtkMenuItem">
                <property name="visible">True</property>
                <child>
                    <object class="GtkBox" id="box">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <child>
                            <object class="GtkLabel">
                                <property name="visible">True</property>
                                <property name="label" translatable="yes">Label 1</property>
                                <property name="use_underline">True</property>
                                <property name="halign">start</property>
                            </object>
                        </child>
                        <child>
                            <object class="GtkLabel">
                                <property name="visible">True</property>
                                <property name="label" translatable="yes">Label 2</property>
                                <property name="use_underline">True</property>
                                <property name="halign">end</property>
                            </object>
                        </child>
                    </object>
                </child>
            </object>
        </child>
    </object>
</interface>

Am I missing something?

0

There are 0 answers