Download TraitsUI 4 User Manual

Transcript
TraitsUI 4 User Manual, Release 4.6.0.dev153
• Set the shared_editor parameter of TreeEditor() to True.
• Set the editor parameter of TreeEditor() to the object returned in Step 1.
For example:
shared_tree_1 = TreeEditor(shared_editor = True,
editor = my_shared_editor_pane,
nodes = [ TreeNode( # ...
)
]
)
shared_tree_2 = TreeEditor(shared_editor = True,
editor = my_shared_editor_pane,
nodes = [ TreeNode( # ...
)
]
)
Defining the Format
Several parameters to TreeEditor() affect the formatting of the tree control:
• show_icons: If True (the default), icons are displayed for the nodes in the tree.
• icon_size: A two-integer tuple indicating the size of the icons for the nodes.
• lines_mode: Determines whether lines are displayed between related nodes. The valid values are ‘on’, ‘off’, and
‘appearance’ (the default). When set to ‘appearance’, lines are displayed except on Posix-based platforms.
• hide_root: If True, the root node in the hierarchy is not displayed. If this parameter were specified as True in
Example 16, the node in Figure 54 that is labeled “Acme Labs, Inc.” would not appear.
Additionally, several attributes of TreeNode also affect the display of the tree:
• icon_path: A directory path to search for icon files. This path can be relative to the module it is used in.
• icon_item: The icon for a leaf node.
• icon_open: The icon for a node with children whose children are displayed.
• icon_group: The icon for a node with children whose children are not displayed.
The wxWidgets implementation automatically detects the bitmap format of the icon.
1.11 “Extra” Trait Editor Factories
The traitsui.wx package defines a few editor factories that are specific to the wxWidgets toolkit, some of which are
also specific to the Microsoft Windows platform. These editor factories are not necessarily implemented for other GUI
toolkits or other operating system platforms.
1.11.1 AnimatedGIFEditor()
Suitable for File
Default for (none)
Optional parameters playing
1.11. “Extra” Trait Editor Factories
89