Re: Getting parent Gtk::window



On Thu, 2009-01-15 at 16:04 +0000, Pedro Sousa wrote:
> Hi to all,
> 
> I can't find information how to get a pointer to a widget parent
> Gtk::Window. I know that the method "get_parent_window" return the a
> Glib::RefPtr<Gdk::Window>,

Note that get_parent() returns a Gtk::Widget (actually a Gtk::Container)
rather than a Gdk::Widget.

>  but this isn't useful because I can't use it
> with the method "set_transient_for" for a local Gtk::Dialog.
> Another task I need to perform with the parent window pointer is to
> enable or disable the sensitivity of the parent window.
[snip]

I think you want Gtk::Widget::get_toplevel(). Just dynamic_cast thre
result to a Gtk::Window*:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Widget.html#c92a0dc8751c828406ca8755f013b75c

-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



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