[Mono-list] GTK# on Windows since Mono 1.2...

David Cantin david_cantin at videotron.ca
Thu Dec 6 15:33:45 EST 2007


Hi, I have a similar problem than you with my gtk# applications on Windows. But, I was able to solve your test case by using the gtk-sharp-2.10 assembly instead of gtk-sharp.

So use 
	mcs -pkg:gtk-sharp-2.10 test2.cs 
instead of 
	mcs -pkg:gtk-sharp test2.cs

But, that didn't solve mine. I'm trying to create a simple test case. But my bug is difficult to reproduce in a simple application... anyway.. maybe more on that later.

David

Le mercredi 28 novembre 2007 à 12:17 -0500, Philip Covington a écrit :
> Hello,
> 
> I am using GTK# with Mono on Windows.  The following test program
> works on Mono versions 1.2 and older.  On Mono versions 1.2.1 and
> later (all the way to 1.2.5.2) when I click the button widget, I get
> an error (see below).  I have included the test app (test2.cs) and the
> command line arguments used to compile it below.  I have the exact
> same problem with Glade#.  The test program is copied off of the GTK#
> tutorial page.
> 
> This seems to be a problem since 1.2.1, but I was surprised not to
> have found any information about this problem in searching around.
> Should I be using GTK# on Windows or is no one actually using it on
> Windows (hence no bug report)?
> 
> Thanks,
> Phil Covington
> http://www.philcovington.com
> 
> ---------------------------------------------------------
> test2.cs:
> ---------------------------------------------------------
> using Gtk;
> using System;
> 
> public class ButtonApp  {
> 
>      public static int Main (string[] args)
>      {
>           Application.Init ();
>           Window win = new Window ("Button Tester");
>           win.SetDefaultSize (200, 150);
>           win.DeleteEvent += new DeleteEventHandler (Window_Delete);
>           Button btn = new Button ("Click Me");
>           btn.Clicked += new EventHandler (btn_click);
>           win.Add (btn);
>           win.ShowAll ();
>           Application.Run ();
>           return 0;
>      }
> 
>      static void btn_click (object obj, EventArgs args)
>      {
>           Console.WriteLine ("Button Clicked");
>      }
> 
>      static void Window_Delete (object obj, DeleteEventArgs args)
>      {
>           Application.Quit ();
>           args.RetVal = true;
>      }
> }
> -------------------------------------------------------------------------------------
> 
> test2.cs compiled with:
> 
> >mcs -pkg:gtk-sharp test2.cs
> 
> run:
> 
> >mono test2.exe
> 
> --------------------------------------------------------------------
> Mono 1.2:
> 
> C:\Data\project>mono test2.exe
> Button Clicked
> Button Clicked
> Button Clicked
> Button Clicked
> 
> C:\Data\project>
> 
> ---------------------------------------------------------------------
> Mono 1.2.1:
> 
> C:\Data\project>>mono test2.exe
> Button Clicked
> 
> =================================================================
> Got a SIGSEGV while executing native code. This usually indicates
> a fatal error in the mono runtime or one of the native libraries
> used by your application.
> =================================================================
> 
> Stacktrace:
> 
>   at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
>   at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
>   at Gtk.Application.Run () <0x00007>
>   at ButtonApp.Main (string[]) <0x000f2>
>   at (wrapper runtime-invoke) System.Object.runtime_invoke_int_string[] (object,
> intptr,intptr,intptr) <0xffffffff>
> 
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> 
> C:\Data\project>
> -------------------------------------------------------------------
> 
> Mono 1.2.5.2:
> 
> 
> C:\Data\project>mono test2.exe
> Button Clicked
> Stacktrace:
> 
>   at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
>   at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
>   at Gtk.Application.Run () <0x00007>
>   at ButtonApp.Main (string[]) <0x000ee>
>   at (wrapper runtime-invoke) ButtonApp.runtime_invoke_int_string[] (object,intp
> tr,intptr,intptr) <0xffffffff>
> 
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> 
> C:\Data\project>
> -----------------------------------------------------------------------
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list



More information about the Mono-list mailing list