After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639559 - GdkWindow pod on subclassing
GdkWindow pod on subclassing
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2011-01-14 19:56 UTC by Kevin Ryde
Modified: 2011-09-30 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.28 KB, patch)
2011-01-14 19:56 UTC, Kevin Ryde
needs-work Details | Review
new docs (1.59 KB, patch)
2011-08-30 23:22 UTC, Kevin Ryde
committed Details | Review

Description Kevin Ryde 2011-01-14 19:56:57 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.
Comment 1 Torsten Schoenfeld 2011-08-08 15:42:19 UTC
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>, [...]"?
Comment 2 Kevin Ryde 2011-08-30 23:22:59 UTC
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?
Comment 3 Torsten Schoenfeld 2011-09-30 21:07:57 UTC
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.