[Gtk-sharp-list] Problems using the new constructors for FileChooserDialog

Rafael Teixeira Rafael Teixeira <monoman@gmail.com>
Mon, 31 Jan 2005 13:24:16 -0200


Trying to run such a thing:

   using (FileChooserDialog chooser =
      new FileChooserDialog ("Choose new picture file",
this.MainWindow, FileChooserAction.Open,
      Stock.Cancel, ResponseType.Cancel, Stock.Open, ResponseType.Ok)) {
 
gives

Unhandled Exception: System.InvalidCastException: Cannot cast from
source type to destination type.
in <0x0018f> Gtk.FileChooserDialog:.ctor
(string,Gtk.Window,Gtk.FileChooserAction,string,object[])
in [0x00033] (at
/home/rafael/source/LifeLets/LifeLets.Gui/LLMainWindow.cs:458)
LifeLets.GUI.LLMainWindow:on_change_picture_activate
(object,System.EventArgs)

Well it is choosing the wrong overloaded constructor, as monodis tell us:

	IL_0033:  newobj instance void class
['gtk-sharp']Gtk.FileChooserDialog::.ctor(string, class
['gtk-sharp']Gtk.Window, valuetype ['gtk-sharp']Gtk.FileChooserAction,
string, object[])

Because the signatures are somewhat ambiguous, that is why I reordered
one parameter in my previous patch...

I reopened bug 71818 (http://bugzilla.ximian.com/show_bug.cgi?id=71818)

I'll try to build another patch...
-- 
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.