[Gtk-sharp-list] GTK# App with multiple windows, where doesApplication.Init() and Application.Run() go?

Timothy Parez timothyparez@linux.be
Sat, 26 Mar 2005 15:40:29 +0100


I think Anset was talking from a non-glade point of view.
When using GTK-Sharp without glade this makes perfect sense :)

Timothy

-----Oorspronkelijk bericht-----
Van: gtk-sharp-list-admin@lists.ximian.com
[mailto:gtk-sharp-list-admin@lists.ximian.com] Namens Bjoern Schiessle
Verzonden: zaterdag 26 maart 2005 15:33
Aan: gtk-sharp-list@lists.ximian.com
Onderwerp: Re: [Gtk-sharp-list] GTK# App with multiple windows, where
doesApplication.Init() and Application.Run() go?

Hi,

On Sa, 2005-03-26 at 11:00 +0100, Anset wrote:
> First of all, when you create a "MyWndow" class, make it enherit 
> Gtk.Window. Makes your life easier:
> 
> Class MyWindow : Gtk.Window
> {
> ...
> }

Why should i inherit the MyWindow class from Gtk.Window if i have the
whole window already in the glade file? If i do this, than i would have
two windows, the window represented by the "MyWindow : Gtk.Window" class
and the window i have pulled out of the glade file.

If i don't use glade i would inherit MyWindow from Gtk.Window, but if i
use glade i would do it like this:

class MainWindow {

    public static void Main(string[] args) {
        Application.Init ();
        new MainWindow ();
        Application.Run ();
    }

    public MainWindow () {
        Glade.XML gxml = new Glade.XML (null, "app.glade",
                                        "MainWindow", null);
        gxml.Autoconnect (this);
    }
    ...
}

and the second window which i call somewhere from MainWindow with "new
SubWindow()":

class SubWindow {

    public SubWindow () {
        Glade.XML gxml = new Glade.XML (null, "app.glade",
                                        "SubWindow", null);
        gxml.Autoconnect (this);
    } 
    ....
}

Cheers,
Bjoern

-- 
 ,= ,-_-. =.  Bjoern Schiessle                   <bes@schiessle.org>
((_/)o o(\_)) http://www.schiessle.org  Jabber IM: <bes@amessage.de>
 `-'(. .)`-'  If art interprets our dreams, the computer
     \_/      execute them in the guise of programs!

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.3 - Release Date: 25/03/2005




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.3 - Release Date: 25/03/2005