problems subclassing Gtk::Notebook
- From: Akos Maroy <darkeye tyrell hu>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: problems subclassing Gtk::Notebook
- Date: Wed, 23 Feb 2005 15:02:09 +0100
Hi,
I'm trying to create a custom implementation of Gtk::Notebook, and I'm
having great difficulties.
for one, I wanted to catch the event of a new page added to the Notebook
object. but there's no such event handler. so I considered overriding
all the zillion prepend_page(), insert_page(), etc. functions. but none
of them are declared as virtual, so there's no use in doing so.
as a workaround, I added a function that would create my own
representation of the pages, that could be called explicitly. that
seemed to be OK, but no matter what I do, the widget is rendered as the
stock Gtk::Notebook widget. even if I override the on_realize(),
on_expose_event(), on_map(), etc. functions. what is even more
interesting, is that if I override all these, and call explicitly
Gtk::Container::on_realize(), etc. from them, rendering is still done as
the stock Gtk::Notebook does.
this seems very weird to me, and goes contrary to my C++ knowledge. how
come that Gtk::Notebook::on_realize() can be called, if I explicitly
call Gtk::Container::on_realize() myself?
or is it so, that Gtk::Container::on_realize() and the like check what
kind of object this is, and execute code accordingly? well, that it's
quite contrary to generic object inheritance logic...
Akos
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]