Ubuntu,gtk 3.10.8,无法可视化由 Glade 制作的菜单栏

Ubuntu,gtk 3.10.8,无法可视化由 Glade 制作的菜单栏

我的问题是,我用 Glade 绘制了一个 UI,但是菜单栏不想被绘制

这是 xml,仅供参考:请尝试查看属性。这是一个非常简单的菜单栏,但我找不到问题所在。

我尝试在属性中设置一些内容,但都失败了。有人能帮助我吗?

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.10"/>
  <object class="GtkImage" id="image3">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="stock">gtk-help</property>
    <property name="icon_size">1</property>
  </object>
  <object class="GtkWindow" id="window1">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkBox" id="box1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkMenuBar" id="menubar1">
            <property name="visible">True</property>
            <property name="app_paintable">True</property>
            <property name="can_focus">False</property>
            <property name="halign">start</property>
            <property name="valign">start</property>
            <property name="margin_left">1</property>
            <property name="margin_right">1</property>
            <property name="margin_top">1</property>
            <property name="margin_bottom">1</property>
            <child>
              <object class="GtkMenuItem" id="menuitem1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="label" translatable="yes">_File</property>
                <property name="use_underline">True</property>
                <child type="submenu">
                  <object class="GtkMenu" id="menu1">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <child>
                      <object class="GtkMenuItem" id="imagemenuitem1">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="label" translatable="yes">Converti</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkMenuItem" id="imagemenuitem2">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="label" translatable="yes">Avanti</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkImageMenuItem" id="imagemenuitem3">
                        <property name="label" translatable="yes">Aiuto</property>
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="image">image3</property>
                        <property name="use_stock">False</property>
                        <property name="always_show_image">True</property>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkButton" id="button1">
            <property name="label" translatable="yes">button</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">1</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
</interface>

答案1

你的 glade 文件没有任何问题。

Ubuntu 使用 Unity,它在桌面顶部显示菜单栏!

相关内容