[Glade-devel] Any hints on how to implement



--=-aZqlpzDotuNUBuOaUwmX
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi all,

Can I please get some thoughts on how to handle this problem I'm
having!?

libglade and Glade2 both support having a widget in the tab label of a
GtkNotebook. In fact in this is the default behaviour in Glade2. In
Glade3 currently only the tab-label text property (sets an internally
handled GtkLabel) is supported.

So to support the loading of .glade files from Glade2 it would be nice
to support this feature. However, it is implemented in a strange way
which is making it hard to do so. The tab label widgets are saved as
children of the GtkNotebook (when strictly speaking they are not as far
as Gtk is concerned) but with a packing property of type=tab!! So a file
saved by glade2 has every second GtkNotebook child as the tab label
widget of the previous child!! (I have attached a glade2 example file).

Thus I am finding it hard to think of how this could be cleanly
implemented by changes in glade-gtk.c. Any thoughts would be
appreciated. 

Thankyou, Shane

--=-aZqlpzDotuNUBuOaUwmX
Content-Disposition: attachment; filename=g2-nbtest.glade
Content-Type: application/x-glade; name=g2-nbtest.glade
Content-Transfer-Encoding: 7bit

<?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">window1</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_NONE</property>
  <property name="modal">False</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>

  <child>
    <widget class="GtkNotebook" id="notebook1">
      <property name="visible">True</property>
      <property name="can_focus">True</property>
      <property name="show_tabs">True</property>
      <property name="show_border">True</property>
      <property name="tab_pos">GTK_POS_TOP</property>
      <property name="scrollable">False</property>
      <property name="enable_popup">False</property>

      <child>
        <widget class="GtkButton" id="button1">
          <property name="visible">True</property>
          <property name="can_focus">True</property>
          <property name="label" translatable="yes">tab1</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="tab_expand">False</property>
          <property name="tab_fill">True</property>
        </packing>
      </child>

      <child>
        <widget class="GtkLabel" id="label1">
          <property name="visible">True</property>
          <property name="label" translatable="yes">tablabel1</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>
        </widget>
        <packing>
          <property name="type">tab</property>
        </packing>
      </child>

      <child>
        <widget class="GtkButton" id="button2">
          <property name="visible">True</property>
          <property name="can_focus">True</property>
          <property name="label" translatable="yes">tab2</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="tab_expand">False</property>
          <property name="tab_fill">True</property>
        </packing>
      </child>

      <child>
        <widget class="GtkLabel" id="label2">
          <property name="visible">True</property>
          <property name="label" translatable="yes">tablabel2</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>
        </widget>
        <packing>
          <property name="type">tab</property>
        </packing>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>

--=-aZqlpzDotuNUBuOaUwmX--





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]