[Gtk-sharp-list] Problems and fixing ups

Francis Brosnan Blázquez francis at aspl.es
Tue Jun 7 15:14:17 EDT 2005


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.

-------------- next part --------------
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);
	}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.glade
Type: text/xml
Size: 1996 bytes
Desc: not available
Url : http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050607/1d479b53/test.xml


More information about the Gtk-sharp-list mailing list