[Gtk-sharp-list] GTK# App with multiple windows, where does Application.Init()
and Application.Run() go?
Anset
Anset@anset.org
Sat, 26 Mar 2005 19:02:02 +0100
True,
but as I wrote at the end, ditch glade. It's great for a quick app, but
if you want to do anything fancy at all, it just won't work.
Allso, I hate not being in controll of my own application. Glade just
makes things complicated and it certainly does not help someone who is
just starting out with gtk... Too many things are hidden, and since the
doc for gtk is so sparse (I do not mean api info, I mean tut's en such)
glade is not a "good thing"(tm)
Of course, this is my opinion, and I do not expect anybody to agree with
me. :)
Anset
Bjoern Schiessle wrote:
> 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
>