[Gtk-sharp-list] show gnome window in glade
Rob Brown-Bayliss
rbb@orcon.net.nz
Sun, 16 May 2004 10:21:55 +1200
On Sun, 2004-05-16 at 10:05, John Luke wrote:
> When you step into the Gnome-side of things you have to make sure it is
> also initialized. Instead of Gtk.Application.Init () and
> Gtk.Application.Run() you need to do:
> Gnome.Program p = new Gnome.Program ("Name", "Version",
> Gnome.Modules.UI, args);
> and p.Run (); which initializes the underlying gnome libs. Also, look
> for a line in the .glade file like:
> <requires lib="gnome" />.
Thanks, I found some thing similar on the list archives, and modified
the Main.cs file as created by monodevelop to this:
public class GladeApp : Gnome.Program
{
public static void Main (string[] args)
{
new GladeApp (args);
}
public GladeApp (string[] args) : base ("thd", "0.1",
Modules.UI, args, new object [0])
{
Application.Init();
Glade.XML gxml = new Glade.XML (null, "thd.glade",
"app1", null);
gxml.Autoconnect (this);
Application.Run();
}
/* Connect the Signals defined in Glade */
public void on_app1_delete_event (object o, DeleteEventArgs
args)
{
Application.Quit ();
args.RetVal = true;
}
}
Some things I dont quite get though, is "Application" a variable setup
some where? is it the same as "Gtk.Application" ?
in this line:
public GladeApp (string[] args) : base ("thd", "0.1", Modules.UI, args,
new object [0])
what is "base" representing? and where does it come from?
Thanks again.
--
Rob Brown-Bayliss
=================