Search code examples
c++gtkgtkmm

How to convert 'GtkWidget' type in gtk+ to the 'Gtk::Widget' type in gtkmm?


I simply tried this.

GtkWidget* oldwnd = new GtkWidget();
Gtk::Widget wnd(*oldwnd);

But it does not compile.

Can anybody tell me how to type cast the types in gtk+ to the corresponding types in gtkmm?


Solution

  • Perhaps Gtk::Widget* wnd = Glib::wrap(oldwnd)?

    documentation says

    Gtk::Widget* wrap (GtkWidget* object, bool take_copy=false);