traitsui.extras.demo module

A Traits UI demo that borrows heavily from the design of the wxPython demo.

class traitsui.extras.demo.Demo

Bases: traits.has_traits.HasPrivateTraits

default_traits_view()

Constructs the default traits view.

class traitsui.extras.demo.DemoButton

Bases: traits.has_traits.HasPrivateTraits

class traitsui.extras.demo.DemoError

Bases: traits.has_traits.HasPrivateTraits

class traitsui.extras.demo.DemoFile

Bases: traitsui.extras.demo.DemoTreeNodeObject

has_children()

Returns whether or not the object has children.

class traitsui.extras.demo.DemoFileHandler

Bases: traitsui.handler.Handler

closed(info, is_ok)

Closes the view.

execute_test(df, locals)

Executes the file in df.path in the namespace of locals.

flush()
init(info)

Initializes the controls of a user interface.

This method is called after all user interface elements have been created, but before the user interface is displayed. Override this method to customize the user interface before it is displayed.

Parameters:info (UIInfo object) – The UIInfo object associated with the view
Returns:initialized – A Boolean, indicating whether the user interface was successfully initialized. A True value indicates that the UI can be displayed; a False value indicates that the display operation should be cancelled. The default implementation returns True without taking any other action.
Return type:bool
write(text)
class traitsui.extras.demo.DemoPath

Bases: traitsui.extras.demo.DemoTreeNodeObject

get_children()

Gets the object’s children.

get_children_from_config()

Gets the object’s children as specified in its configuration file or dictionary.

get_children_from_datastructure()

Gets the object’s children based on the filesystem structure.

has_children()

Returns whether or not the object has children.

has_py_files(path)
class traitsui.extras.demo.DemoTreeNodeObject

Bases: traitsui.tree_node.TreeNodeObject

get_children(node)

Gets the object’s children.

has_children(node)

Returns whether or not the object has children.

tno_allows_children(node)

Returns whether chidren of this object are allowed or not.

tno_get_children(node)

Gets the object’s children.

tno_has_children(node=None)

Returns whether or not the object has children.

class traitsui.extras.demo.ModalDemoButton

Bases: traitsui.extras.demo.DemoButton

traitsui.extras.demo.demo(use_files=False, dir_name=None, config_filename='', title='Traits UI Demos')
traitsui.extras.demo.extract_docstring_from_source(source)

Return module docstring and source code from python source code.

Parameters:source (Str (Unicode)) – Python source code.
Returns:
  • docstring (str) – The first module-level string; i.e. the module docstring.
  • source (str) – The source code, sans docstring.
traitsui.extras.demo.parse_source(file_name)

Return module docstring and source code from python source file.

Returns:
  • docstring (str) – The first module-level string; i.e. the module docstring.
  • source (str) – The source code, sans docstring.
traitsui.extras.demo.user_name_for(name)

Previous topic

traitsui.extras.checkbox_column module

Next topic

traitsui.extras.edit_column module

This Page