traitsui.editors.list_editor module

Defines the list editor factory for the traits user interface toolkits..

class traitsui.editors.list_editor.ListEditor(*args, **traits)[source]

Bases: EditorFactory

Editor factory for list editors.

columns = columns_trait

The number of list columns to create:

deletable = Bool(False)

Are notebook items deletable?

deletable_trait = Str()

The extended name of the trait on each page object which should be used to determine whether or not an individual page should be deletable.

dock_style = DockStyle

FIXME: Currently, this trait is used only in the wx backend. Dock page style to use for each DockControl:

dock_theme = Any()

FIXME: Currently, this trait is used only in the wx backend. The DockWindow graphical theme

editor = editor_trait

The editor to use for each list item:

export = Str()

Export class for each item in a notebook:

factory = Callable()

A factory function that can be used to define that actual object to be edited (i.e. view_object = factory( object )):

item_factory = Callable()

Factory that will be called to create and add a new element to this list. If None, the default value for the trait of interest is used.

item_factory_args = Tuple()

Tuple of positional arguments to be passed to the default factory callable when creating new elements

item_factory_kwargs = Dict()

Dictionary of keyword arguments to be passed to the default factory callable when creating new elements

mutable = Bool(True)

Can the list be reorganized, or have items added and deleted.

page_name = Str()

Extended name to use for each notebook page. It can be either the actual name or the name of an attribute on the object in the form: ‘.name[.name…]’

rows = rows_trait

The number of list rows to display:

scrollable = Bool(True, sync_value=True)

Should the scrollbars be displayed if the list is too long.

selected = Str()

Name of the [object.]trait[.trait…] to synchronize notebook page selection with:

show_notebook_menu = Bool(False)

Show a right-click context menu for the notebook tabs? (Qt only)

style = style_trait

The style of editor to use for each item:

trait_handler = handler_trait

The trait handler for each list item:

ui_kind = Enum("subpanel", "panel")

The type of UI to construct (‘panel’, ‘subpanel’, etc)

use_notebook = Bool(False)

Use a notebook for a custom view?

view = AView

Name of the view to use in notebook mode:

class traitsui.editors.list_editor.ListItemProxy(object, name, index, trait, value)[source]

Bases: HasTraits

index = Int()

The item proxies index into the original list:

list = Property()

The list proxy:

traitsui.editors.list_editor.ToolkitEditorFactory

alias of ListEditor

traitsui.editors.list_editor.columns_trait = Range(1, 10, 1, desc="the number of list columns to display")

The visible number of columns displayed

traitsui.editors.list_editor.handler_trait = Instance(BaseTraitHandler)

Trait whose value is a BaseTraitHandler object

traitsui.editors.list_editor.rows_trait = Range(1, 50, 5, desc="the number of list rows to display")

The visible number of rows displayed