Re: [Inkscape-devel] GTK+ and GTKMM problems
I think the best thing to do would be to rewrite the desktop window code to use a Gtk::Window rather than a GtkWindow as the top-level window. It's a small step towards the complete Gtkmmification we have been wanting anyway.
I agree, and I'm embarking on this process. My investigations have lead me to this little gem in edgit-widget.cpp:
void * EditWidget::getWindow() { return this ; } This surprised me a little as EditWidget is a subclass of Gtk::Window. EditWidget is cast into a void*, then in SPDesktop::getToplevel it's cast into GtkWindow*. Can someone explain to me why EditWidget::getWindow returns a void* not a Gtk::Window*? why is the type thrown out? Am I missing something here? I'm very surprised that this series of casts works at all. I assume that the Gtk::Window class contains GtkWindow* as the first member. Shouldn't this be fixed?
Joel
----------------------------------------
From: MenTaLguY <mental@...3...> Sent: 06 July 2007 15:21 To: joel@...1709... Subject: Re: [Inkscape-devel] GTK+ and GTKMM problems
On Fri, 6 Jul 2007 15:09:04 -0700, "joel@...1709..." wrote:
What I really want here is "temporary wrapper" just to satisfy FileChooserDialog. There seems to be rather a lack of documentation about all this - or maybe I don't know where to look.
Glib::wrap wasn't intended to be used that way.
Am I right in thinking that while all inkscape dialogs use Gtkmm, the main window is based on plain old GTK+ ? If not, is there a way I can get a reference to it's underlying Gtk::Window rather than a crumby GtkWindow*?
I think the best thing to do would be to rewrite the desktop window code to use a Gtk::Window rather than a GtkWindow as the top-level window. It's a small step towards the complete Gtkmmification we have been wanting anyway.
-mental
On Sat, 2007-07-07 at 13:56 -0700, joel@...1709... wrote:
This surprised me a little as EditWidget is a subclass of Gtk::Window. EditWidget is cast into a void*, then in SPDesktop::getToplevel it's cast into GtkWindow*.
Uh, wow.
Can someone explain to me why EditWidget::getWindow returns a void* not a Gtk::Window*? why is the type thrown out? Am I missing something here? I'm very surprised that this series of casts works at all. I assume that the Gtk::Window class contains GtkWindow* as the first member. Shouldn't this be fixed?
Yes, please?
The right process for getting a GtkWindow * from a Gtk::Window should be to use Gtk::Window::gobj().
-mental
participants (2)
-
joel@...1709...
-
MenTaLguY