### Starting a Qt Event Loop for TraitsUI in Python Source: https://github.com/enthought/traitsui/blob/main/docs/source/tutorials/traits_ui_scientific_app.rst Illustrates how to make a TraitsUI panel 'live' by creating a Qt application and starting its event loop. This is necessary for user interactions to be processed in the GUI. ```python from pyface.qt.QtGui import QApplication from traits.api import HasTraits from traitsui.api import View class Counter(HasTraits): value = 0 traits_view = View( 'value' ) counter = Counter() # Create a Qt application instance app = QApplication([]) # Display the panel and start the event loop counter.edit_traits(kind='live') # Start the Qt event loop app.exec_() ``` -------------------------------- ### Install etsdemo with GUI Backends Source: https://github.com/enthought/traitsui/blob/main/ets-demo/README.rst Commands to install the etsdemo package with specific GUI backend dependencies using pip. ```bash pip install etsdemo[pyside2] pip install etsdemo[pyqt5] pip install etsdemo[wx] ``` -------------------------------- ### Launch with Custom Data Sources Source: https://github.com/enthought/traitsui/blob/main/ets-demo/README.rst Demonstrates how to initialize the application with a list of custom data source dictionaries instead of relying on installed packages. ```python from etsdemo.main import main main([ { "version": 1, "name": "Project X Examples", "root": pkg_resources.resource_filename("my_project", "data"), } ]) ``` -------------------------------- ### TraitsUI View: Wizard Style Example Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/custom_view.rst Demonstrates how to display a TraitsUI View in a wizard-style window. Wizard views are modal and live, presenting groups as sequential pages and ignoring the View's 'buttons' attribute. This example requires the WX backend. ```python from traits.api import HasTraits, Str from traitsui.api import View, Group, Item, Wizard class Page1(HasTraits): name = Str('World') view = View( Item('name'), title='Page 1', kind='wizard' ) class Page2(HasTraits): message = Str('Hello') view = View( Item('message'), title='Page 2', kind='wizard' ) class MainWindow(HasTraits): page1 = Page1() page2 = Page2() view = View( Group( 'page1', 'page2', kind='wizard' ), title='Wizard Example', kind='wizard' ) if __name__ == '__main__': MainWindow().edit_traits() ``` -------------------------------- ### Implement Instance Editor with Selection Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factories_basic.rst Demonstrates how to configure an InstanceEditor to allow users to select an instance from a list and edit its attributes. This example uses the 'name' parameter to define the source of selectable instances. ```python from traits.api import HasTraits, Instance, List, Str from traitsui.api import View, Item, InstanceEditor class Person(HasTraits): name = Str() class Team(HasTraits): roster = List(Instance(Person)) captain = Instance(Person) view = View( Item('captain', editor=InstanceEditor(name='roster')), 'roster' ) ``` -------------------------------- ### Configure TraitsUI View with Command Buttons Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/custom_view.rst Demonstrates how to define a View object with specific command buttons using the buttons attribute. This example shows how to use pre-defined button sets like OKCancelButtons to manage form actions. ```python from traitsui.api import View, Item from traitsui.menu import OKCancelButtons view = View( Item('name'), buttons=OKCancelButtons, title='Example View' ) ``` -------------------------------- ### Create Changelog News Fragment (CLI) Source: https://github.com/enthought/traitsui/blob/main/docs/releases/README.rst This command-line tool automates the creation of news fragments for the changelog. It prompts the user for necessary information and requires the 'click' library to be installed. The generated fragment will be used in the next release's changelog. ```python python etstool.py changelog create ``` -------------------------------- ### Implement Enumeration Editor with Mapped Values Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factories_basic.rst Demonstrates how to use the EnumEditor with mapped values to control sorting and display order. The example shows how to use numeric tags to define the order of items in the enumeration. ```python from traits.api import HasTraits, Enum from traitsui.api import View, Item, EnumEditor class EnumDemo(HasTraits): # Example using mapped values for custom sorting selection = Enum('01:Apple', '02:Banana', '03:Cherry') view = View( Item('selection', editor=EnumEditor(values={'01:Apple': 'Apple', '02:Banana': 'Banana', '03:Cherry': 'Cherry'})) ) ``` -------------------------------- ### Example of Interaction Handling Logic Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_dev_guide/testing.rst Provides pseudo-code for a fallback mechanism where if an interaction is not directly supported by a target, it attempts to use a default target. This pattern allows for broader interaction support. ```python def perform(interaction, target): try: _perform(interaction, target): except InteractionNotSupported: try: default_target = locate(DefaultTarget, target) except LocationNotSupported: raise InteractionNotSupported else: _perform(interaction, default_target) ``` -------------------------------- ### Example of DateEditor Update in Qt Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_dev_guide/testing.rst Demonstrates the specific method call required to update a date trait for a DateEditor in a Qt environment. This highlights the toolkit-specific nature of direct editor manipulation. ```python editor.update_object(QDate(...)) ``` -------------------------------- ### TraitsUI: Example of Using Editor Styles at Various Levels Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factory_intro.rst This Python script demonstrates how to apply different editor styles (Item, Group, and View levels) in TraitsUI. It shows how the 'style' attribute on Item, Group, and View objects determines the appearance and behavior of UI elements, with the Item level taking precedence over Group, and Group over View. ```python from traits.api import HasTraits, Str, Enum from traitsui.api import View, Item, Group, EnumEditor class Employee(HasTraits): first_name = Str() last_name = Str() department = Enum("Sales", "Engineering", "Marketing") position_type = Enum("Full-time", "Part-time", "Contractor") view = View( Group( Item("first_name", style='text'), Item("last_name", style='text'), Group( Item("department", editor=EnumEditor(input_name='department', values=["Sales", "Engineering", "Marketing"])), style='custom' ), Item("position_type", style='readonly') ), title='Employee Information', style='simple' ) if __name__ == '__main__': employee = Employee() employee.configure_traits() ``` -------------------------------- ### Define Data Source Entry Point Source: https://github.com/enthought/traitsui/blob/main/ets-demo/README.rst Shows how to define a metadata function and register it in setup.py to contribute data to the etsdemo application. ```python def info(request): return { "version": 1, "name": "Project X Examples", "root": pkg_resources.resource_filename("my_project", "data"), } # In setup.py setup( name="my_project", entry_points={ "etsdemo_data": ["my_demo = my_project.info:info"], } ) ``` -------------------------------- ### GET /tabular_adapter/cell_data Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/adapters.rst Retrieves or sets the text content and tooltip information for a specific table cell. ```APIDOC ## GET /tabular_adapter/get_text ### Description Returns the string representation of the data for a specified cell. ### Method GET ### Endpoint /tabular_adapter/get_text ### Parameters #### Query Parameters - **row** (int) - Required - The row index. - **column** (int) - Required - The column index. ### Response #### Success Response (200) - **text** (string) - The display text for the cell. --- ## POST /tabular_adapter/set_text ### Description Updates the underlying data representation after a user completes an editing operation on a table cell. ### Method POST ### Request Body - **text** (string) - Required - The new value entered by the user. - **row** (int) - Required - The row index. - **column** (int) - Required - The column index. ``` -------------------------------- ### GET trait_views() Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/tips.rst Retrieves a list of named View elements associated with a HasTraits object class. ```APIDOC ## GET trait_views() ### Description Returns a list of names of all View elements defined in the object's class. Can be filtered by element type. ### Method GET ### Endpoint /trait_views(view_element_type=None) ### Parameters #### Query Parameters - **view_element_type** (string) - Optional - The type of element to filter by (View, Group, Item, ViewElement, ViewSubElement). ### Response #### Success Response (200) - **view_names** (list) - A list of strings representing the names of the requested view elements. #### Response Example ["all_view", "traits_view"] ``` -------------------------------- ### Launch etsdemo Programmatically Source: https://github.com/enthought/traitsui/blob/main/ets-demo/README.rst Demonstrates how to launch the demo application from a Python script or interpreter. ```python from etsdemo.main import main main() ``` -------------------------------- ### GET /traits/editor-factories Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/predefined_traits.rst Retrieves the mapping of Trait types to their corresponding default and alternative editor factories. ```APIDOC ## GET /traits/editor-factories ### Description Returns a list of predefined Traits and their associated UI editor factories. This allows developers to understand which editor is used by default for a specific data type and what alternatives are supported. ### Method GET ### Endpoint /traits/editor-factories ### Parameters None ### Request Example GET /traits/editor-factories ### Response #### Success Response (200) - **trait_type** (string) - The name of the Trait type (e.g., Bool, Int, List). - **default_editor** (string) - The primary editor factory used by default. - **alternative_editors** (array) - A list of other compatible editor factories. #### Response Example { "Bool": { "default_editor": "BooleanEditor", "alternative_editors": ["ThemedCheckboxEditor"] }, "List": { "default_editor": "TableEditor/ListEditor", "alternative_editors": ["CSVListEditor", "CheckListEditor", "SetEditor", "ValueEditor"] } } ``` -------------------------------- ### Create Product UI Items with TraitsUI Source: https://context7.com/enthought/traitsui/llms.txt Illustrates creating various UI elements for a Product model using TraitsUI's Item and its variants. It covers standard items, unlabeled items (UItem), read-only displays, custom editors, size specifications, conditional visibility, enabling, and layout spacing. Requires 'traits' and 'traitsui' libraries. ```python from traits.api import HasTraits, Str, Int, Float, Enum, Range from traitsui.api import View, Item, UItem, Readonly, Custom, spring class Product(HasTraits): name = Str() price = Float() quantity = Int() category = Enum('Electronics', 'Clothing', 'Food', 'Other') rating = Range(1, 5) view = View( # Standard labeled item Item('name', label='Product Name', tooltip='Enter the product name'), # Unlabeled item (UItem) UItem('category'), # Readonly display Readonly('price', format_str='$%.2f'), # Custom style (typically larger widget) Custom('rating'), # Item with size specification Item('quantity', width=100, height=30), # Conditional visibility - only show when category is Electronics Item('rating', visible_when="category == 'Electronics'"), # Conditional enabling Item('quantity', enabled_when='price > 0'), # Spring for flexible spacing spring, resizable=True, ) product = Product(name='Laptop', price=999.99, quantity=10, category='Electronics') product.configure_traits() ``` -------------------------------- ### TraitsUI Group Object Example Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/view.rst Illustrates how to use the Group object in TraitsUI to enclose a set of widgets within a visible border and a text label, enhancing interface organization. ```python from traitsui.api import View, Item, Group # Assuming 'my_object' is an instance with traits 'name', 'age', 'address' # For demonstration, let's define a simple traits object from traits.api import HasTraits, Str, Int class MyData(HasTraits): name = Str('John Doe') age = Int(30) address = Str('123 Main St') my_object = MyData() view = View( Group( Item('name'), Item('age'), Item('address'), label='User Information', show_border=True ) ) # To display this view, you would typically use: # my_object.configure_traits(view=view) # The provided example in the text uses 'configure_traits_view_group.py' # which would contain a similar structure. # For brevity, the full script is not included here, but the Group definition is key. # Example of nested groups nested_view = View( Group( Group( Item('name'), label='Personal Details' ), Group( Item('age'), Item('address'), label='Contact Info' ), label='User Profile', show_border=True ) ) ``` -------------------------------- ### TraitsUI Item Subclasses Examples Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/view.rst Demonstrates the usage of various Item subclasses in TraitsUI, such as Label, Heading, and Spring, which are useful for UI layout and do not necessarily require an associated trait. ```python from traitsui.api import Item, Label, Heading, Spring # Example usage of Label and Spring label_item = Label("This is a label") spring_item = Spring() # Example of creating a custom item custom_item = Item(style='custom') # Example of creating a readonly item readonly_item = Item(style='readonly') # Example of an item with no label no_label_item = Item(show_label=False) # Example of a custom item with no label ucustom_item = Item(style='custom', show_label=False) # Example of a readonly item with no label ureadonly_item = Item(style='readonly', show_label=False) ``` -------------------------------- ### Initialize UITester with Custom Registries Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/testing/discussions/working_of_extensions.rst Demonstrates how to instantiate the UITester class by passing a list of custom registry objects. The order of the list determines the priority of interaction and location support. ```python tester = UITester(registries=[custom_registry, another_registry]) ``` -------------------------------- ### Define a TreeNode with Children Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factories_advanced_extra.rst Configures a TreeNode to display child nodes by mapping the 'children' attribute to a trait on the object. This example uses a literal string for the label by prefixing it with an equals sign. ```python TreeNode( node_for=[Company], auto_open=True, children='departments', label='=Departments', view=no_view, add=[Department], ) ``` -------------------------------- ### Initialize a CheckListEditor Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factory_intro.rst Shows how to initialize a CheckListEditor by providing a list of values to the editor factory. ```python from traitsui.api import Item, CheckListEditor Item( name='my_list', editor=CheckListEditor( values=["opt1", "opt2", "opt3"], ), ) ``` -------------------------------- ### Using configure_traits() Method Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/advanced_view.rst Details the configure_traits() method for creating standalone windows from Views, including options for saving/restoring trait values. ```APIDOC ## DELETE /api/users/{id} ### Description Deletes a user from the system based on their unique identifier. ### Method DELETE ### Endpoint /api/users/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the user to delete. ### Response #### Success Response (204) No content is returned upon successful deletion. #### Response Example (No content) ``` -------------------------------- ### Organizing UI Items with Layout Groups Source: https://context7.com/enthought/traitsui/llms.txt Demonstrates how to use various layout containers such as Tabbed, VGroup, HGroup, VGrid, HSplit, and VSplit to structure TraitsUI views. These containers allow for complex, responsive layouts with borders and labels. ```python from traits.api import HasTraits, Str, Int, Bool, Float from traitsui.api import View, Item, Group, HGroup, VGroup, Tabbed, HSplit, VSplit, VGrid class Person(HasTraits): first_name = Str() last_name = Str() age = Int() email = Str() phone = Str() newsletter = Bool(False) notifications = Bool(True) view = View( Tabbed( VGroup(Item('first_name'), Item('last_name'), Item('age'), label='Personal', show_border=True), HGroup(VGroup(Item('email'), Item('phone'), label='Contact')), VGrid(Item('newsletter'), Item('notifications'), label='Preferences', columns=2), ), title='Person Information', resizable=True, width=400, height=300, ) class SplitDemo(HasTraits): left_content = Str() right_content = Str() top_content = Str() bottom_content = Str() view = View( HSplit(Item('left_content', style='custom'), VSplit(Item('top_content', style='custom'), Item('bottom_content', style='custom'))), resizable=True, width=600, height=400, ) ``` -------------------------------- ### Define a TreeNodeObject for Dictionary Structures Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/adapters.rst Example of subclassing TreeNodeObject to wrap a dictionary structure for display in a TreeEditor. This approach allows for custom node labels and parent tracking within the tree hierarchy. ```python class DictNode(TreeNodeObject): #: The parent of the node parent = Instance('DictNode') #: The label for the node label = Str() ``` -------------------------------- ### Implementing UI Logic with Handlers and Controllers Source: https://context7.com/enthought/traitsui/llms.txt Shows how to create custom Handler classes to manage view lifecycle events and attribute changes. It also demonstrates the Controller class for implementing the Model-View-Controller pattern to separate UI logic from data models. ```python from traits.api import HasTraits, Str, Int, Bool, TraitError from traitsui.api import View, Item, Handler, Controller, UIInfo class MyHandler(Handler): def init(self, info: UIInfo) -> bool: print("UI initialized") return True def close(self, info, is_ok): print("User clicked OK" if is_ok else "User clicked Cancel") return True def setattr(self, info, object, name, value): print(f"Setting {name} to {value}") Handler.setattr(self, info, object, name, value) class PersonController(Controller): allow_empty_name = Bool(True) view = View(Item('name'), Item('age'), Item('controller.allow_empty_name'), buttons=['OK', 'Cancel']) def name_setattr(self, info, object, name, value): if not self.allow_empty_name and not value.strip(): raise TraitError("Name cannot be empty") return super().setattr(info, object, name, value) ``` -------------------------------- ### Test TraitsUI GUI Interactions Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/testing/tutorials/first_test.rst Demonstrates how to use UITester to open a GUI, locate fields, simulate typing with KeySequence, and assert the resulting state using DisplayedText. ```python from traitsui.testing.api import DisplayedText, KeySequence, UITester form = Form() tester = UITester(delay=50) with tester.create_ui(form) as ui: first_name_field = tester.find_by_name(ui, "first_name") last_name_field = tester.find_by_name(ui, "last_name") full_name_field = tester.find_by_name(ui, "full_name") first_name_field.perform(KeySequence("Leia")) last_name_field.perform(KeySequence("Skywalker")) displayed = full_name_field.inspect(DisplayedText()) assert displayed == "Leia Skywalker" ``` -------------------------------- ### Configure ListEditor for Object Collections Source: https://context7.com/enthought/traitsui/llms.txt Shows how to use ListEditor to render lists of HasTraits objects in different layouts. Includes examples for notebook tabs, flow layouts, and simple mutable lists with add/remove functionality. ```python from traits.api import HasTraits, Str, Int, List, Instance from traitsui.api import View, Item, Group, ListEditor, InstanceEditor class Address(HasTraits): street = Str() city = Str() country = Str() traits_view = View( Item('street'), Item('city'), Item('country'), ) def __str__(self): return f"{self.city}, {self.country}" class Person(HasTraits): name = Str() addresses = List(Instance(Address)) notebook_view = View( Item('name'), Item('addresses', style='custom', editor=ListEditor(use_notebook=True, page_name='.city'), show_label=False), title='Addresses (Notebook)', resizable=True, height=400, ) flow_view = View( Item('name'), Item('addresses', editor=ListEditor(style='custom', rows=3), show_label=False), title='Addresses (Flow)', resizable=True, ) simple_view = View( Item('name'), Item('addresses', editor=ListEditor( style='simple', mutable=True, )), title='Addresses (Simple)', resizable=True, ) person = Person( name='John Doe', addresses=[ Address(street='123 Main St', city='New York', country='USA'), Address(street='456 High St', city='London', country='UK'), ] ) person.configure_traits(view='notebook_view') ``` -------------------------------- ### Registering Toolkit Interactions with QLineEdit Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_dev_guide/testing.rst This snippet demonstrates how to register a specific interaction type (KeySequence) with a target UI element (QLineEdit) using a registry. It highlights a design choice that was later rejected due to complexity and obscurity. ```python from pyface.qt.QtGui import QLineEdit from traitsui.api import KeySequence from traitsui.testing.api import registry registry.register_interaction( target_type=QLineEdit, interaction_type=KeySequence, handler=..., # some callable ) ``` -------------------------------- ### Example of DateEditor Update in Wx Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_dev_guide/testing.rst Illustrates the process of updating a date trait for a DateEditor in a Wx environment. This involves creating a specific Wx event and calling a toolkit-dependent method, showcasing the complexity of cross-toolkit testing. ```python event = wx.adv.DateEvent(...) event.SetDate(...) editor.day_selected(event) ``` -------------------------------- ### Defining and Implementing Custom Actions Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/handler.rst Shows how to define a custom Action in a Handler and integrate it into a View's buttons, menu bars, or toolbars. ```python from pyface.api import ImageResource # Define the action recalc = Action(name="Recalculate", action="do_recalc") # Add to View buttons View(buttons=[OKButton, CancelButton, recalc]) # Add to View menubar View(menubar=MenuBar(Menu(my_action, name='My Special Menu'))) # Define with toolbar attributes recalc = Action( name="Recalculate", action="do_recalc", toolip="Recalculate the results", image=ImageResource("recalc.png"), ) # Add to View toolbar View(toolbar=ToolBar(my_action)) ``` -------------------------------- ### Define Hierarchical TreeEditor Structure Source: https://context7.com/enthought/traitsui/llms.txt Illustrates the setup of a TreeEditor for viewing nested data structures. It utilizes TreeNode definitions to map object types to tree nodes, supporting context menus and hierarchical navigation. ```python class Employee(HasTraits): name = Str('') title = Str() class Department(HasTraits): name = Str('') employees = List(Employee) class Company(HasTraits): name = Str('') departments = List(Department) ``` -------------------------------- ### Override Default View with default_traits_view Method (Python) Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/advanced_view.rst This example shows how to dynamically define a default view by overriding the default_traits_view() method in a HasTraits class. This is useful when the view layout depends on the object's state at runtime. ```python from traits.api import HasTraits, View, Int, Instance class MyModel(HasTraits): value = Int(0) def default_traits_view(self): return View( 'value' ) model = MyModel() model.configure_traits() ``` -------------------------------- ### Configure Shared TreeEditor Panes Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factories_advanced_extra.rst Demonstrates how to create a shared editor pane and associate multiple TreeEditor instances with it to synchronize the editing view across different tree controls. ```python my_shared_editor_pane = TreeEditor(shared_editor=True) 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(...), ], ) ``` -------------------------------- ### Configure Item with Text and HTML Editors Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factory_intro.rst Demonstrates how to define an Item in a TraitsUI View using the default text editor versus the specialized HTMLEditor. ```python from traitsui.api import Item, HTMLEditor # Default text editor Item(name='my_string') # Using HTMLEditor Item(name='my_string', editor=HTMLEditor()) ``` -------------------------------- ### Python Test Failure due to Missing Observers Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/testing/tutorials/first_test.rst This is a traceback example showing an AssertionError that occurs when a test attempts to assert the value of the `full_name` field, but the `@observe` decorators were not applied to the update method, causing the field to remain unchanged. ```bash Traceback (most recent call last): File "first-test.py", line 35, in assert displayed == "Leia Skywalker" AssertionError ``` -------------------------------- ### Testing Modal Dialogs with UITester and ModalDialogTester Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/testing/discussions/compatibility_pyface_testing.rst Demonstrates how to use ModalDialogTester to handle a modal dialog triggered by a UITester action. It includes setting up the tester and using open_and_run to interact with the dialog. ```python from pyface.constant import OK from pyface.toolkit import toolkit_object from traitsui.testing.api import MouseClick, UITester ModalDialogTester = toolkit_object("util.modal_dialog_tester:ModalDialogTester") tester = UITester() with tester.create_ui(demo) as ui: simple_button = tester.find_by_id(ui, "simple") def click_simple_button(): simple_button.perform(MouseClick()) modal_tester = ModalDialogTester(click_simple_button) modal_tester.open_and_run(lambda x: x.click_button(OK)) assert modal_tester.dialog_was_opened ``` -------------------------------- ### Instantiate and manipulate a Point object Source: https://github.com/enthought/traitsui/blob/main/docs/source/tutorials/traits_ui_scientific_app.rst Shows how to create an instance of the Point class, modify its attributes, and invoke its methods to perform geometric transformations. ```python from numpy import pi p = Point() p.x = 1 p.rotate_z(pi) print(p.x) print(p.y) ``` -------------------------------- ### VideoEditor for Displaying Video Content (Qt) Source: https://github.com/enthought/traitsui/blob/main/docs/source/traitsui_user_manual/factories_advanced_extra.rst The VideoEditor is a display-only editor for video content, currently available only on the Qt platform. Users may need to install external codecs depending on their operating system for various video formats to play correctly. ```python VideoEditor() ```