traitsui.ui module

Defines the UI class used to represent an active traits-based user interface.

class traitsui.ui.Dispatcher(method, info, object, method_name)

Bases: object

dispatch()

Dispatches the method.

remove()

Removes the dispatcher.

class traitsui.ui.UI

Bases: traits.has_traits.HasPrivateTraits

Information about the user interface for a View.

add_checked(checked_when, editor)

Adds a conditionally enabled (menu) Editor object to the list of monitored ‘checked_when’ objects.

add_defined(method)

Adds a Handler method to the list of methods to be called once the user interface has been constructed.

add_enabled(enabled_when, editor)

Adds a conditionally enabled Editor object to the list of monitored ‘enabled_when’ objects.

add_visible(visible_when, editor)

Adds a conditionally enabled Editor object to the list of monitored ‘visible_when’ objects.

disposable_traits = ['view_elements', 'info', 'handler', 'context', 'view', 'history', 'key_bindings', 'icon', 'rebuild']
dispose(result=None, abort=False)

Disposes of the contents of a user interface.

do_undoable(action, *args, **kw)

Performs an action that can be undone.

eval_when(when, result=True)

Evaluates an expression in the UI’s context and returns the result.

evaluate(function, *args, **kw_args)

Evaluates a specified function in the UI’s context.

find(include)

Finds the definition of the specified Include object in the current user interface building context.

finish()

Finishes disposing of a user interface.

get_editors(name)

Returns a list of editors for the given trait name.

get_error_controls()

Returns the list of editor error controls contained by the user interface.

get_extended_value(name)

Gets the current value of a specified extended trait name.

get_prefs(prefs=None)

Gets the preferences to be saved for the user interface.

get_ui_db(mode='r')

Returns a reference to the Traits UI preference database.

key_handler(event, skip=True)

Handles key events.

pop_level(level)

Restores a previously pushed search stack level.

prepare_ui()

Performs all processing that occurs after the user interface is created.

push_level()

Returns the current search stack level.

recyclable_traits = ['_context', '_revert', '_defined', '_visible', '_enabled', '_checked', '_search', '_dispatchers', '_editors', '_names', '_active_group', '_undoable', '_rebuild', '_groups_cache']
recycle()

Recycles the user interface prior to rebuilding it.

reset(destroy=True)

Resets the contents of a user interface.

restore_prefs()

Retrieves and restores any saved user preference information associated with the UI.

route_event(event)

Routes a “hooked” event to the correct handler method.

save_prefs(prefs=None)

Saves any user preference information associated with the UI.

set_prefs(prefs)

Sets the values of user preferences for the UI.

sync_view()

Synchronize context object traits with view editor traits.

traits_init()

Initializes the traits object.

ui(parent, kind)

Creates a user interface from the associated View template object.

Previous topic

traitsui.tree_node module

Next topic

traitsui.ui_editor module

This Page