[Mono-dev] Fwd: Toolbar properties don't work. Request for a new glade library in the next win32 Mono.

Gena don at env.com.ua
Sun Nov 13 11:58:51 EST 2005


Hi all,

I had some problems changing size of the toolbar icons to
IconSize.SmallToolbar with the lates Mono installation for *Win32*
platform. When default libglade is used the program displays message:

(<unknown>:4664): Gtk-WARNING **: Mixing deprecated and non-deprecated
GtkToolbar API is not allowed

and I guess that is the reaon why Toolbar.IconSize property is not working.

After digging a bit and writing test application I've found that it
really happens because of old glade library.

So my question: is it is possible to include the last glade dll in the
next mono installation (http://gladewin32.sourceforge.net released
them on 22.10.2005)? Which Gtk library is used usually during Win32
Mono port release?

Everything works fine (icon size is changed to small) when I replace
default Mono libraries (libglade-2.0-0.dll and libatk-1.0-0.dll) with
the ones from Glade 2.8.6-rc3).

--
Gena

==========================================
The test code, ToolbarTest.cs:

namespace ToolbarTest {

        using Gtk;
        using Gdk;
        using Glade;
        using System;

        public class Gui {

                [Widget] Gtk.Window window;
                [Widget] Toolbar toolbar;
                [Widget] ToolButton button;

                public static int Main (string[] args)
                {
                        Application.Init ();

                        Gui gui = new Gui();

                        gui.InitGlade();


                        Application.Run ();
                        return 0;
                }

                public void InitGlade()
                {
                        Glade.XML gxml = new Glade.XML(this.GetType().Assembly,
"test.glade", "window", null);
                        gxml.Autoconnect(this);
                        SetSmallIcons(); // >>> fails with default
Mono libglade! <<<
                }

                public void Init()
                {
                        window = new Gtk.Window ("Test");

                        VBox box = new VBox (false, 0);
                        window.Add (box);

                        toolbar = new Toolbar();
                        ToolButton button = new ToolButton(Stock.Add);
                        toolbar.Add(button);
                        box.PackEnd(toolbar, true, true, 0);
                        toolbar.ToolbarStyle = ToolbarStyle.Icons;
                        toolbar.IconSize = IconSize.SmallToolbar;
                        window.ShowAll();

                }

                private void SetSmallIcons()
                {
                        toolbar.ToolbarStyle = ToolbarStyle.Icons;
                        toolbar.IconSize = IconSize.SmallToolbar;
                }
        }
}

test.glade:

<?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="window">
  <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="GtkVBox" id="vbox1">
      <property name="visible">True</property>
      <property name="homogeneous">False</property>
      <property name="spacing">0</property>

      <child>
        <widget class="GtkToolbar" id="toolbar">
          <property name="visible">True</property>
          <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
          <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
          <property name="tooltips">True</property>
          <property name="show_arrow">True</property>

          <child>
            <widget class="GtkToolButton" id="button">
              <property name="visible">True</property>
              <property name="label" translatable="yes"></property>
              <property name="use_underline">True</property>
              <property name="stock_id">gtk-add</property>
              <property name="visible_horizontal">True</property>
              <property name="visible_vertical">True</property>
              <property name="is_important">False</property>
            </widget>
            <packing>
              <property name="expand">False</property>
              <property name="homogeneous">True</property>
            </packing>
          </child>

          <child>
            <placeholder/>
          </child>

          <child>
            <placeholder/>
          </child>
        </widget>
        <packing>
          <property name="padding">0</property>
          <property name="expand">False</property>
          <property name="fill">False</property>
        </packing>
      </child>

      <child>
        <placeholder/>
      </child>

      <child>
        <placeholder/>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>



More information about the Mono-devel-list mailing list