Glade gui editor for gtk-sharp3

425 views Asked by At

I followed this official guide: http://www.mono-project.com/docs/gui/gtksharp/beginners-guide/

As that tutorial says, my gui.glade is:

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">

<glade-interface>

<widget class="GtkWindow" id="window1">
  <property name="visible">True</property>
  <property name="title" translatable="yes">Glade Window</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_CENTER</property>
  <property name="modal">False</property>
  <property name="default_width">256</property>
  <property name="default_height">256</property>
  <property name="resizable">True</property>
  <property name="destroy_with_parent">False</property>
  <property name="decorated">True</property>
  <property name="skip_taskbar_hint">False</property>
  <property name="skip_pager_hint">False</property>
  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
  <property name="focus_on_map">True</property>

  <child>
    <widget class="GtkScrolledWindow" id="scrolledwindow1">
      <property name="visible">True</property>
      <property name="can_focus">True</property>
      <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
      <property name="shadow_type">GTK_SHADOW_IN</property>
      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>

      <child>
    <widget class="GtkLayout" id="layout1">
      <property name="visible">True</property>
      <property name="width">400</property>
      <property name="height">400</property>
      <property name="hadjustment">0 0 400 10 212.4 236</property>
      <property name="vadjustment">0 0 400 10 212.4 236</property>

      <child>
        <widget class="GtkLabel" id="label1">
          <property name="width_request">38</property>
          <property name="height_request">17</property>
          <property name="visible">True</property>
          <property name="label" translatable="yes">label1</property>
          <property name="use_underline">False</property>
          <property name="use_markup">False</property>
          <property name="justify">GTK_JUSTIFY_LEFT</property>
          <property name="wrap">False</property>
          <property name="selectable">False</property>
          <property name="xalign">0.5</property>
          <property name="yalign">0.5</property>
          <property name="xpad">0</property>
          <property name="ypad">0</property>
          <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
          <property name="width_chars">-1</property>
          <property name="single_line_mode">False</property>
          <property name="angle">0</property>
        </widget>
        <packing>
          <property name="x">96</property>
          <property name="y">88</property>
        </packing>
      </child>

      <child>
        <widget class="GtkButton" id="button1">
          <property name="width_request">60</property>
          <property name="height_request">27</property>
          <property name="visible">True</property>
          <property name="can_focus">True</property>
          <property name="label" translatable="yes">button1</property>
          <property name="use_underline">True</property>
          <property name="relief">GTK_RELIEF_NORMAL</property>
          <property name="focus_on_click">True</property>
        </widget>
        <packing>
          <property name="x">88</property>
          <property name="y">168</property>
        </packing>
      </child>
    </widget>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>

And compile command:

mcs -pkg:glade-sharp-2.0 -resource:gui.glade glade.cs

I was happy it works fine. But of course, I don't want to write gui designer code without designer, so I installed Glade editor (version 3.20). But Glade refuses to open above file. I have also noticed syntax generated by Glade is completly different: glade tag instead of glade-interface, object instead of widget etc.

Can you provide some tip where to get gui designer suitable for gtk-sharp3? Also, .glade files generated by Glade are not working with gtk# 3.0.

0

There are 0 answers