Chaining up to GtkWidgetClass methods



Hi,

Jody asked me if I could take a look at a problem in Gnumeric, where
nothing happened when pressing the Menu key on the spreadsheet.  The
problem was that FooCanvas's ::key-press-event handler did not chain up
to the handler in GtkWidgetclass.

It turns out that it's not clear at all when one must chain up to the
handler in the parent class.  From a quick scan of the source:

- key_press_event and key_release_event need chaining for bindings to
work.

- show/hide need chaining for invariants to be met.

- grab_focus needs chaining so that GtkWidget can do scary stuff with
the toplevel.

Those special cases should be documented, and the docs should also
mention which handlers just provide default behavior which one can
completely override.

  Federico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]