Re: pure libglademm applications



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

weijie wrote:
> I was thinking whether using classes for each window would be better
> than non-OOP libglademm coding. Is it?
> Thanks!
>

When I started using libglademm in conjunction with Glade, I decided to
create an application class that contained pointers to the Gtk::Window
that would be displayed, along with pointers to the various controls
contained in that window with which I would need to interact.  Then, in
the contructor of my app class, I would use libglademm to intiate the
window and get the pointer values to the controls mentioned above.
After instantiation of the app class I would start up the whole GUI in
main.cpp like this:

int main(int argc, char *argv[])
{
    Gtk::Main kit(argc,argv);
    MyAppClass ap;

    kit.run(*ap.win);   // win is the pointer to
                        // application window returned
                        // by libglademm get_widget routine
    return 0;
}

Hope this helps.

Bob Caryl


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFFIQ+wuCj6XIbb5UIRAqQRAKCMopL8jPy/VNISV1Hc5rPboQ9bJwCfVIyi
l3DyCcCmwzVntaQrVQPQSGg=
=hUCu
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]