![]() |
![]()
| ![]() |
![]()
See the file man.macros. NAMEWidget - base class for mega-widgets within a frame INHERITANCEitk::Archetype <- itk::Widget STANDARD OPTIONSbackground cursor See the "options" manual entry for details on the standard options. DESCRIPTIONThe Widget class inherits everything from the Archetype class, and adds a Tk frame called the "hull" component to represent the body of the mega-widget. The window class name for the hull is set to the most-specific class name for the mega-widget. The protected variable itk_interior contains the window path name for the "hull" component. Derived classes specialize this widget by packing other widget components into the hull. Since the hull for the Widget class is implemented with a Tk frame, mega-widgets in the Widget class can be packed into other frames and toplevels. COMPONENTSName: hull Class: Frame
EXAMPLEThe following example implements a simple TextDisplay mega-widget. It creates a read-only display of text with a text widget and a scrollbar. option add *TextDisplay.wrap none widgetDefault option add *TextDisplay.textBackground ivory widgetDefault option add *TextDisplay.width 40 widgetDefault option add *TextDisplay.height 10 widgetDefault itcl::class TextDisplay {
itcl::body TextDisplay::display {info} {
itcl::body TextDisplay::append {info} {
itk::usual TextDisplay {
# # EXAMPLE: Display the /etc/passwd file # TextDisplay .file -background red pack .file .file display [exec cat /etc/passwd] KEYWORDSitk, Archetype, Widget, mega-widget
|