[Gtk-sharp-list] deprecated Combo not working in gtk# 1.0 on Win32 using gtk+ 2.6

Daniel Morgan danielmorgan at verizon.net
Mon Jun 27 20:28:52 EDT 2005


Both gtk# 1.0 and gtk# 1.9 are shipped with the mono 1.1.7 and 1.1.8 
windows installers.  Using -pkg:gtk-sharp will use gtk# 1.0 while 
-pkg:gtk-sharp-2.0 will use gtk# 1.9.  Both are installed in Mono's 
GAC.  So, both are running okay.  I did port sql# for gtk# to gtk# 2.0 
using a ComboBox, and it works okay.   However, my problem is with Combo 
working on gtk# 1.0.

Sorry, I could not get bugzilla to work for me today.  So, here is the 
error.

Take the Combo example in monodoc and run it. 

E:\backup_stuff\sqlsharpgtk>mcs ComboTest.cs -pkg:gtk-sharp

E:\backup_stuff\sqlsharpgtk>mono ComboTest.exe

(<unknown>:168): GLib-CRITICAL **: g_convert: assertion `str != NULL' failed

Unhandled Exception: System.NullReferenceException: Object reference not 
set to
an instance of an object
in <0x00152> ComboSample:.ctor ()
in <0x00016> ComboSample:Main ()

This is the source:

using System;
using Gtk;

class ComboSample {
    Combo combo;
    
    static void Main () {
        new ComboSample ();    
    }
    
    ComboSample () {
        Application.Init ();
    
        Window win = new Window ("ComboSample");
        win.DeleteEvent += new DeleteEventHandler (OnWinDelete);

        string[] list = new string[] {"one", "two", "three"};
         
        combo = new Combo ();
        combo.PopdownStrings = list;
        combo.DisableActivate ();
        combo.Entry.Activated += new EventHandler (OnEntryActivated);
         
        win.Add (combo);
    
        win.ShowAll ();
        Application.Run ();
    }
    
    void OnEntryActivated (object o, EventArgs args) {
        Console.WriteLine (combo.Entry.Text);
    }
    
    void OnWinDelete (object obj, DeleteEventArgs args) {
        Application.Quit ();
    }
}

Mike Kestner wrote:

>On Sat, 2005-06-25 at 19:50 -0400, Daniel Morgan wrote:
>  
>
>>When I tried to run sql# for gtk# on Mono 1.1.7 for Windows, it failed 
>>to run because the Combo failed.
>>sql# for gtk# was using gtk# 1.0.x and gtk+ 2.6. 
>>
>>Even though Combo was deprecated in gtk+ 2.4, it should still work in 
>>gtk+ 2.6.
>>
>>I recently chatted with Todd Berman, and he said the deprecated Combo 
>>works fine in MonoDevelop running on gtk+ 2.6.
>>
>>So, is this a Win32 problem with gtk+, gtk# 1.0.x , or the installer?
>>
>>Can someone please look into this problem?
>>    
>>
>That's going to be hard to do without more details than "the Combo
>failed."  If you can provide a minimal sample application that
>reproduces the problem, please open a bug report including the output
>that occurs on failure.  
>
>When you say you "tried to run sql# for gtk# on Mono 1.1.7 for Windows"
>are you saying you tried to run a binary that was compiled against Gtk#
>1.0.x on mono 1.1.7?  There are different assembly versions involved
>there, so if the 1.1.7 installer doesn't have a set of Gtk# 1.0.x
>assemblies in its GAC, that would be a problem.  I'm just stabbing in
>the dark because the problem description above is fairly vague.
>
>Gtk# 1.0.x and 2.x are parallel-installable and there is no current plan
>to provide a mechanism to run applications compiled against 1.0.x on a
>2.x installation.  You will still have to have 1.0.x assemblies
>installed.  If this is the problem you are indicating, perhaps paco
>needs to consider shipping a combined 1.0.x/2.x installer for Gtk# on
>win32?  Either that or there needs to be a way to install 1.0.x and 2.x
>Gtk# into a single mono install.
>
>FWIW, I just compiled and ran the sample/test/WidgetViewer.exe
>application on the MS 1.1 runtime with gladewin 2.6.8-rc1 and Gtk# trunk
>and the Combo sample (which is still Gtk.Combo, not ComboBox) runs
>without any problems.
>
>  
>



More information about the Gtk-sharp-list mailing list