[Gtk-sharp-list] Re: Fwd: Re: Some questions about layout management in Gtk# 2.0

Eric Butler eric at extremeboredom.net
Sat May 14 15:16:56 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your code compiles and runs fine for me.

$ mcs -pkg:glade-sharp-2.0 -pkg:gtk-sharp-2.0 Test.cs
- -resource:project1.glade


Michael Thomsen wrote:
> ---------- Forwarded message ----------
> From: Michael Thomsen <mikerthomsen at gmail.com>
> Date: May 14, 2005 2:54 PM
> Subject: Re: [Gtk-sharp-list] Re: Some questions about layout
> management in Gtk# 2.0
> To: Eric Butler <eric at extremeboredom.net>
> 
> 
> The error message is:
> 
> C:\project1>C:\mono\bin\mono Test.exe
> 
> (<unknown>:1620): GLib-CRITICAL **: g_convert: assertion `str != NULL' failed
> 
> Unhandled Exception: System.ArgumentException: Object type cannot be converted t
> o target type.
> Parameter name: val
> in <0x000ba> System.Reflection.MonoField:SetValue (System.Object obj, System.Obj
> ect val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Global
> ization.CultureInfo culture)
> in <0x0017c> Glade.XML:BindFields (System.Object target, System.Type type)
> in <0x00019> Glade.XML:BindFields (System.Object target)
> in <0x00016> Glade.XML:Autoconnect (System.Object handler)
> in <0x00047> Test:.ctor ()
> in <0x00016> Test:Main (System.String[] args)
> 
> C:\project1>
> 
> On 5/14/05, Eric Butler <eric at extremeboredom.net> wrote:
> 
> Michael Thomsen wrote:
> 
>>1) How do you put two elements such as a label and a combobox in a 2
>>element VBox and have them set to be variable sizes? Let's say I want
>>the label to take up 20% of the space and the comobox to take up 80%
>>of the space. Is this even possible with Gtk#'s layout management?
> 
> I do not believe Gtk supports percentage widths, but I think you will
> find that it's generally not something you need. You can place your
> label and widget in either a GtkTable or GtkHBox to have it size them
> properly.
> 
> If you do not believe this will work for you, please reply with a more
> specific explination of what you wish to achieve.
> 
> 
>>2) When I try to reference a ComboBox object marked with a [Widget]
>>attribute from a Glade file, my test program crashes. Could someone
>>explain why this happens? Below is the code in question:
> 
> I am assuming you are getting a type cast exception. If I am wrong, you
> should post the error!!! In glade, select the widget and look in the
> Properties window under "Class". You are probably using a
> GtkComboBoxEntry (Gtk.ComboBoxEntry) instead of a GtkComboBox, or
> something to that effect.
> 
> Regards,
> Eric
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

- ------------------------------------------------------------------------

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFChk6osSPwEOmqwCIRAr4PAJ0QU4WZQjexvXAGROkyUJYxtHW60ACfTRXw
6ET6Fgmj/p5l7nWggzDP/dw=
=E1RV
-----END PGP SIGNATURE-----


More information about the Gtk-sharp-list mailing list