Check out the new USENIX Web site. next up previous
Next: Delayed Update/Redraw Model Up: Architecture of the Canvas Previous: Grouping of Items

Behavior of Items

The canvas does not have any predefined behavior for items. Instead, the programmer will connect to the event signals of the different canvas items, capture events from the user, and define whatever behavior is appropriate to the application.

When an event signal is emitted for an item, it is propagated up the item hierarchy and re-emitted for its parent groups until one event handler marks the event as `handled'. This allows the user to treat a group of items as a single meta-item; only a single signal connection is required to receive events from any of the items in a group.

Items can receive the following events: button presses and releases, pointer motion events, key presses and releases, focus in/out events, and mouse enter/leave notifications. Thus, items are very similar to normal GTK+ widgets or X windows from the programmer's point of view.



Federico Mena Quintero
2000-05-08