Getting parent Gtk::window



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>, 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.

I saw a solution, which was to copy a pointer of the base window into
its children. And the children copy, again, the pointer to its children,
etc. For example, this behavior can be implemented using the class
constructor

MessageDialog::MessageDialog (Gtk::Window* parentWindow) :
    mWidgetParent (parentWindow)
{
}

I don't like this solution, because is very error prune. Is this the
only possible solution?

Best regards
Pedro Sousa


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