Commit 2046d749 authored by Torsten Schönfeld's avatar Torsten Schönfeld

Add some docs about overriding virtual functions

parent 2162a9b1
......@@ -527,6 +527,21 @@ example:
my $button = Gtk3::Button->new;
Gtk3::WidgetClass::find_style_property ($button, 'image-spacing')
=head2 Overriding virtual functions
When subclassing a gtk+ class or when implementing a gtk+ interface with
L<Glib::Object::Subclass>, you can override any virtual functions that the
class has by simply defining sub routines with names obtained by capitalizing
the original names of the virtual functions. So, for example, if you implement
a custom subclass of C<Gtk3::CellRenderer> and want to override its virtual
function C<render>, you provide a sub routine with the name C<RENDER> in your
package.
sub RENDER {
my ($cell, $cr, $widget, $background_area, $cell_area, $flags) = @_;
# do something
}
=head1 DESCRIPTION FOR LIBRARY BINDING AUTHORS
=head2 C<< Glib::Object::Introspection->setup >>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment