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

Canvas Items and the GTK+ Object System

Canvas items are GTK+ objects derived from an abstract GnomeCanvasItem class, which defines several methods that all items must implement. These methods are used to perform drawing, hit testing, and updating of items when their attributes change.

Using the GTK+ object system for canvas items provides several advantages:

All the attributes of canvas items, like color, position, and line style, are configured and queried using the GTK+ object argument system. Canvas items may have many configurable attributes, so using the argument system allows us to minimize the number of API entry points, and also makes it easy to write language bindings for the canvas and its items -- all canvas item attributes can be configured using a single function call.


next up previous
Next: Grouping of Items Up: Architecture of the Canvas Previous: Architecture of the Canvas
Federico Mena Quintero
2000-05-08