Re: adding a window into a widget



43b53 bv6542b wrote:
Hi.
I am using gtkmm in a windows xp platform.
I need to add a Gtk::Window into a Gtk::Widget.

Gtk::Window win0, win1;
Gtk::Frame f;
f.add(win1);

This code crashes.
Could you kindly help me?
Thank you very much.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Gtk:: window is ment to be the toplevel window, which is the base of the application. So you can add a Gtk::Frame to a Gtk::Window, but not the other way around.

example
#include <gtkmm.h>

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

Gtk::Window window;
Gtk::Frame testframe;
window.add(testframe);
window.show();

Gtk::Main::run(window);
kit.run();

return 0;
}

and this will  show you a toplevel window with a frame in it

Regards
Kees Kling


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