Renderables
In the Common Widgets subsystem, widgets require applications to provide a strongly typed visual object. For example, labels are required to be an instance of String, and images must be instances of CgIcon or CgPixmap. In the Extended Widgets subsystem, the visual object types are less restrictive. Most extended widget label, icon, or image resources require only that the supplied visual object conform to a specified rendering protocol. Any object that conforms to this protocol and can display (render) itself is called a renderable.
To be renderable, an object needs to implement the following messages to provide sizing information and perform drawing operations: ewWidthUsing:, ewHeightUsing:, and ewDrawUsing:. The classes CgDeviceIndependentImage, CgIcon, CgPixmap, Character, Object, String, and UndefinedObject have been extended to provide rendering protocol. Instances of these classes can be supplied for any extended widget resource requiring a renderable.
You can add rendering protocol to other visual objects in your application. For example, a colored string renderable can be made by combining a String and a CgRGBColor into a ColoredString object.
Tip:
When you are prototyping, the overhead of creating icons can be an inconvenience. Because any renderable can be used in the container widgets it is sometimes useful to use a String in place of a CgIcon.
Last modified date: 01/29/2015