The table tree widget (EwTableTree) is a combination of the table list widget and icon tree widget. Like the table list widget, it displays attributes of items in columnar format. Like the icon tree widget, it also provides a hierarchical view of the items. The columns and their callbacks are created and set up in the same way as they are for the table list widget.
The following example creates a scrolled table tree widget. The column definitions and column callbacks are the same as the EwTableList example. The defaultActionCallback and childrenCallback methods are hooked and handled the same as in the EwIconTree example. The visualInfoCallback must be hooked for a table tree. Athough the icon and label information are not specified (they are specified as cell values), the hasChildren flag must be set.
Object subclass: #TableTreeExample instanceVariableNames: " classVariableNames: " poolDictionaries: 'CwConstants EwConstants'
open | shell tableList | shell := CwTopLevelShell createApplicationShell: 'shell' argBlock: [:w | w title: 'Table Tree Example']. tableList := shell createScrolledTableTree: 'scrolled table tree' argBlock: [:w | w columns: self columns; items: (Array with: Object); selectionPolicy: XmCELLSINGLESELECT]. ... "Callbacks are hooked as in previous examples" ...
visualInfo: widget clientData: clientData callData: callData "Specify whether the item has children. All other values are provided using cell value callbacks." callData hasChildren: callData item subclasses notEmpty