Re: adding a window into a widget



Sorry, but I don't know anything about ogr3d yet, but I started to work on a similar thing. I also want a window in which  I can draw, but then with the Cairo::context. In the tutorial is a chapter about custom widgets, which is the way I try to do it. Perhaps this will be also a lead for you

 http://library.gnome.org/devel/gtkmm-tutorial/unstable/sec-custom-widgets.html.en

regards
Kees Kling


43b53 bv6542b wrote:
Thank you for your answer.
I know that adding a window to a window is not the usual way to use
gtkmm, but I would like to do it because I am trying to embed an
ogre3d "context" in a gtkmm application.


2010/12/2 Kees Kling <ckling upcmail nl>:
  
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]