Hi,

Finally I can confirm the previous error happens while using the gtk# 1.0.9 (assembly version=1.0.0.0) which is bundle with the last Mono installer (1.1.7 with gtk# 1.9.3 but also 1.0.9). This bug causes your app to get a null reference while accessing Gtk.Entry inside a Gtk.ComboBox on Windows XP.

To solve this problem I've compiled and installed the last stable version (I suppose it is) from the svn repository at http://svn.myrealbox.com/source/branches/gtk-sharp-1-0-branch/ over
the actual installation the Mono 1.1.7 installer does.

The current version this gtk-sharp branch claims to have is 1.0.10.99 (extract from configure.in).

In order to compile the gtk-sharp module I've used the mingw and msys packages. Additionally I've used the libraries which the Mono installer comes with. I've created a set of make files called makefile.mingw starting from the already existing make files called makefile.win32.

This set of makefiles are based on mingw. They not only compiles the gtk-sharp module but also prepares the AssemblyInfo.cs files (by using the actual AssemblyInfo.cs.in) without requeiring autotools, install the gtk-sharp.snk file inside the directories building an assembly and allows you to optionally
install the assemblies (by using the gacutil) and the glue dlls.

I think this makefiles may be useful because build ups the gtk-sharp module by using the Mono installation (taking advantage of the libraries which Mono installs) and a simply mingw installation (not all people uses cygwin) based only on two packages (mingw and msys). This will also allow people to solve posible problems by using the last mono installer on windows XP until the next stable realese for gtk-sharp. Mail me if these makefiles can be useful to gtk-sharp project.

The other question I've found while using gtk-sharp is a bug on the glade-sharp module. It is quite simple to reproduce. Set the same method to catch an event on different objects and a NRE will
arise on AutoConnect method. This problem may have relation with the bugs:

http://bugzilla.ximian.com/show_bug.cgi?id=74946
http://bugzilla.ximian.com/show_bug.cgi?id=74216

I've realized this happens on Windows XP but not on Linux (debian installation).

I've also attached a simple test which connects the same signal (clicked with OnClicked method)
to different buttons.

Cheers.

using Gtk;
using Glade;
using System;


public class Test {
        
        public static void Main (string [] args) {

                new Test ();
        }

        public Test () {
                Application.Init ();
                
                Glade.XML gxml = new Glade.XML (null, "test.glade", "window1", 
null);
                gxml.Autoconnect (this);

                Application.Run ();
        }
        
        void OnClicked (object o, EventArgs args) {
                Gtk.Widget w = o as Widget;
                Console.WriteLine ("Clicked on: " + w.Name);
        }
}
<?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>

  <child>
    <widget class="GtkHBox" id="hbox1">
      <property name="visible">True</property>
      <property name="homogeneous">False</property>
      <property name="spacing">0</property>

      <child>
	<widget class="GtkButton" id="button1">
	  <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>
	  <signal name="clicked" handler="OnClicked" last_modification_time="Tue, 07 Jun 2005 19:07:26 GMT"/>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">True</property>
	  <property name="fill">True</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">button2</property>
	  <property name="use_underline">True</property>
	  <property name="relief">GTK_RELIEF_NORMAL</property>
	  <signal name="clicked" handler="OnClicked" last_modification_time="Tue, 07 Jun 2005 19:07:33 GMT"/>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">True</property>
	  <property name="fill">True</property>
	</packing>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to