[Gtk-sharp-list] Using a Dialog box defined with glade with an Gtk.Dialog herited class
mlgs
mlgs at arsis.net
Wed Nov 15 09:13:30 EST 2006
On Wed, 2006-11-15 at 13:23 +0100, lordphoenix wrote:
> Hello
> I should like use a dialog box defined with Glade in a mono application.
> For the moment I'm trying to do it on this way but I didn't succeed :
> First I've defined this class:
>
> public class mydialog : Gtk.Dialog
> {
> public mydialog() : base()
> {
> Glade.XML gxml = new Glade.XMl(null,"gui.glade",mydialog,null);
> gxml.autoconnect(this);
> }
> }
>
Look at this it might help you, you are specifying class instead of name
as it was defined in glade.
Instead of mydialog specify Name as in your gui.glade file (as string).
Copy/Paste from help
====================
Creates an XML object from an System.Reflection.Assembly
public XML (System.Reflection.Assembly assembly, string resource_name,
string root, string domain)
Parameters
assembly
an System.Reflection.Assembly, or null to use the current
assembly
resource_name
the name of the resource in assembly
root
the widget node to start building from, or null.
domain
the translation domain for the XML file (null is the default)
> In order to use this dialogbox I'm using this code :
>
> mydialog dgl = new mydialog();
> int result = mydialog.Run()
> if (result==(int)ResponseType.Ok)
> {//traitement if OK}
> dlg.destroy();
>
> When I'm using this I have a dialog box but it is empty
>
> Someone has an idea about my mistake or about another way to obtain
> same result?
>
> PS : Sorry for my bad English I'm french and don't speak English very
> often :-)
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
More information about the Gtk-sharp-list
mailing list