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

Michael Thomsen mikerthomsen at gmail.com
Sat May 14 14:54:53 EDT 2005

---------- 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)


On 5/14/05, Eric Butler <eric at extremeboredom.net> wrote:
> Hash: SHA1
> 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
> Version: GnuPG v1.2.5 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> iD8DBQFChkB6sSPwEOmqwCIRAoqrAJ9DxUIdw2Gz5c49+KGsA8bheDHDgwCfVhlP
> TQ9jN/+LwT+ZggQUbECDLeg=
> =LWdO
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: project1.glade
Type: application/octet-stream
Size: 1002 bytes
Desc: not available
Url : http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050514/a4267335/project1.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.cs
Type: application/octet-stream
Size: 300 bytes
Desc: not available
Url : http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050514/a4267335/Test.obj

More information about the Gtk-sharp-list mailing list