GNOME Bugzilla – Bug 639559
GdkWindow pod on subclassing
Last modified: 2011-09-30 21:08:00 UTC
Created attachment 178350 [details] [review] patch I didn't know until I tried it that subclassing GdkWindow doesn't work :-(. Perhaps the attached words for the docs.
Review of attachment 178350 [details] [review]: ::: xs/GdkWindow.xs @@ +201,3 @@ +these is created when a widget is "realized". + +As of Gtk 2.22 a window can only be created by It should be 'gtk+ 2.22' to avoid confusion. @@ +208,3 @@ +window creation, and that function always makes a C<GdkWindow> (the +class name argument to the Perl-Gtk C<< Gtk2::Gdk::Window->new >> +wrapper is unused). While it's true that you cannot subclass Gtk2::Gdk::Window from the GType perspective, you can still simply call Gtk2::Gdk::Window->new in your constructor and then re-bless the result. So maybe something like this: "And it's not possible to subclass C<Gtk2::Gdk::Window> using L<Glib::Object::Subclass>, [...]"?
Created attachment 195263 [details] [review] new docs Yes could mention reblessing per new attached, though of course it doesn't quite work. Is there any docs already to cross reference on that?
Thanks, this is exactly what I had in mind. There are a few paragraphs about why re-blessing doesn't cut it in Glib::Object::Subclass' POD, but they don't actually mention the problem you describe.