gui: Main ChimeraX graphical user interface

The principal class that tool writers will use from this module is MainToolWindow, which is either instantiated directly, or subclassed and instantiated to create the tool’s main window. Additional windows are created by calling that instance’s MainToolWindow.create_child_window() method.

Rarely, methods are used from the UI class to get keystrokes typed to the main graphics window, or to execute code in a thread-safe manner. The UI instance is accessed as session.ui.

class ChildToolWindow(tool_instance, title, **kw)

Bases: ToolWindow

Supported API. Child (i.e. additional) tool window

Only created through use of MainToolWindow.create_child_window() method.

class MainToolWindow(tool_instance, **kw)

Bases: ToolWindow

Supported API. Class used to generate tool’s main UI window.

The window’s ui_area attribute is the parent to all the tool’s widgets for this window. Call manage() once the widgets are set up to show the tool window in the main interface.

Parameters:
tool_instance : a ToolInstance instance

The tool creating this window.

create_child_window(title, *, window_class=None, **kw)

Supported API . Make additional tool window

Parameters:
title : str

Text shown in the window’s title bar.

window_class : ChildToolWindow subclass, optional

Class to instantiate to create the child window. Only needed if you want to override methods/attributes in order to change behavior. Defaults to ChildToolWindow.

kw : Keywords to pass on to the tool window’s constructor
class MainWindow(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())

Bases: QMainWindow, PlainTextLog

add_menu_entry(menu_names, entry_name, callback, *, tool_tip=None, insertion_point=None)

Supported API . Add a main menu entry. Adding entries to the Select menu should normally be done via the add_select_submenu method instead. For details, see the doc string for that method.

Menus that are needed but that don’t already exist (including top-level ones) will be created. The menu names (and entry name) can contain appropriate keyboard navigation markup. Callback function takes no arguments. This method cannot be used to add entries to menus that are updated dynamically, such as Tools.

If ‘insertion_point is specified, then the entry will be inserted before it. ‘insertion_point’ can be a QAction, a string (menu item text with navigation markup removed) or an integer indicating a particular separator (top to bottom, numbering starting at 1).

add_menu_selector(menu, label, selector_text=None, *, insertion_point=None)

Supported API . Add an item to the given menu (which was probably obtained with the add_select_submenu method) which will make a selection using the given selector text (which should just be the text of the selector, not a full command) while honoring the current selection mode set in the Select menu. If ‘selector_text’ is not given, it defaults to be the same as ‘label’. The label can have keyboard navigation markup. If ‘insertion_point’ is specified, then the item will be inserted before it. ‘insertion_point’ can be a QAction, a string (menu item text with navigation markup removed) or an integer indicating a particular separator (top to bottom, numbering starting at 1).

add_select_submenu(parent_menu_names, submenu_name, *, append=True)

Supported API . Add a submenu (or get it if it already exists). Any parent menus will be created as needed. Menu names can contain keyboard navigation markup (the ‘&’ character). ‘parent_menu_names’ should not contain the Select menu itself. If ‘append’ is True then the menu will be appended at the end of any existing items, otherwise it will be alphabetized into them.

The caller is responsible for filling out the menu with entries, separators, etc. Any further submenus should again use this call. Entry or menu callbacks that actually make selections should use the select_by_mode(selector_text) method to make the selection, which will run the command appropriate to the current selection mode of the Select menu.

The convenience method add_menu_selector, which takes a menu, a label, and an optional selector text (defaulting to the label) can be used to easily add items to the menu.

closeEvent(self, QCloseEvent)

Experimental API . ..

!! processed by numpydoc !!
customEvent(self, QEvent)

Experimental API . ..

!! processed by numpydoc !!
dragEnterEvent(self, QDragEnterEvent)

Experimental API . ..

!! processed by numpydoc !!
dropEvent(self, QDropEvent)

Experimental API . ..

!! processed by numpydoc !!
enable_stereo(stereo=True)

Experimental API . Switching to a sequential stereo OpenGL context seems to require replacing the graphics window with a stereo compatible window on Windows 10 with Qt 5.9.

log(*args, **kw)

Supported API . Log a message.

Parameters:
level : LOG_XXX constant from Log base class

How important the message is (e.g., error, warning, info)

msg : text

Message to log

Returns:
True if the routine displayed/handled the log message, False otherwise.
resizeEvent(self, QResizeEvent)

Experimental API . ..

!! processed by numpydoc !!
select_by_mode(selector_text)

Supported API . Select based on the selector ‘selector_text’ but honoring the current selection mode chosen in the Select menu. Typically used by callbacks off the Selection menu

status(msg, color, secondary)

Supported API . Show a status message.

Parameters:
msg : plain (non-HTML) text

The message to display

color : text or (r,g,b) tuple, r/g/b in range 0-1

Color to display text in. If log cannot understand color text string, use black instead.

secondary : boolean

Whether to show the status in the secondary status area. If the log doesn’t support a secondary status area it should either drop the status or combine it with the last known primary status message.

Returns:
True if the routine displayed/handled the status, False otherwise.
This method is not abstract because a log is free to totally
ignore/drop status messages.
Note that this method may be called from a thread (due to the
use of timers to get proper time delays) and that therefore
special window toolkit handling may be necessary to get your
code executed in the main thread (*e.g.*, session.ui.thread_safe()).
class SelSeqDialog(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())

Bases: QDialog

class SelZoneDialog(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())

Bases: QDialog

class ToolWindow(tool_instance, title, *, close_destroys=True, statusbar=False)

Bases: StatusLogger

Supported API. An area that a tool can populate with widgets.

This class is not used directly. Instead, a tool makes its main window by instantiating the MainToolWindow class (or a subclass thereof), and any subwindows by calling that class’s create_child_window() method.

The window’s ui_area attribute is the parent to all the tool’s widgets for this window. Call manage() once the widgets are set up to show the tool window in the main interface.

The close_destroys keyword controls whether closing this window destroys it or hides it. If it destroys it and this is the main window, all the child windows will also be destroyed.

The statusbar keyword controls whether the tool will display status messages via an in-window statusbar, or via the main ChimeraX statusbar. In either case, the status() method can be used to issue status messages. It accepts the exact same arguments/keywords as the status() method in the Logger class. The resulting QStatusBar widget (or None if statusbar was False) will be available from the ToolWindow’s “statusbar” in case you need to add widgets to it or otherwise customize it.

cleanup()

Supported API . Perform tool-specific cleanup

Override this method to perform additional actions needed when the window is destroyed

destroy()

Supported API . Called to destroy the window (from non-UI code)

Destroying a tool’s main window will also destroy all its child windows.

fill_context_menu(menu, x, y)

Supported API . Add items to this tool window’s context menu, whose downclick occurred at position (x,y)

Override to add items to any context menu popped up over this window.

Note that you need to specify the ‘parent’ argument of the QAction constructor (as ‘menu’) to avoid having the action automatically destroyed and removed from the menu when this method returns.

manage(placement, fixed_size=False, allowed_areas=15)

Supported API . Show this tool window in the interface

Tool will be docked into main window on the side indicated by placement (which should be a value from placements or ‘side’ or None, or another tool window). If placement is “side”, then the user-preferred side will be used. If placement is None, the tool will be detached from the main window. If placement is another tool window, then those tools will be tabbed together.

The tool window will be allowed to dock in the allowed_areas, the value of which is a bitmask formed from Qt’s Qt.DockWidgetAreas flags.

placements = ['side', 'right', 'left', 'top', 'bottom']

Experimental API . Where the window can be placed in the main interface; ‘side’ is either left or right, depending on user preference

shown

Experimental API . Whether this window is hidden or shown

shown_changed(shown)

Supported API . Perform actions when window hidden/shown

Override to perform any actions you want done when the window is hidden (shown = False) or shown (shown = True)

status(*args, **kw)

Supported API . Show a status message for the tool.

title

Supported API . Get/change window title.

class UI(session)

Bases: QApplication

Main ChimeraX user interface

The only methods that tools might directly use are:

register(/deregister)_for_keystrokes
For the rare tool that might want to get keystrokes that are typed when focus is in the main graphics window
thread_safe
To execute a function in a thread-safe manner
deregister_for_keystrokes(sink, notfound_okay=False)

Experimental API . ‘undo’ of register_for_keystrokes(). Use the same argument.

event(self, QEvent) → bool

Experimental API . ..

!! processed by numpydoc !!
forward_keystroke(event)

Experimental API . forward keystroke from graphics window to most recent caller of ‘register_for_keystrokes’

up/down arrow keystrokes are not forwarded and instead promote/demote the graphics window selection

quit()

Experimental API . ..

!! processed by numpydoc !!
register_for_keystrokes(sink)

Experimental API . ‘sink’ is interested in receiving keystrokes from the main graphics window. That object’s ‘forwarded_keystroke’ method will be called with the keystroke event as the argument.

thread_safe(func, *args, **kw)

Supported API . Call function ‘func’ in a thread-safe manner

class HtmlToolInstance(session, tool_name, size_hint=None, show_http_in_help=True, log_errors=False)

Bases: ToolInstance

Base class for creating a ChimeraX tool using HTML as its main user interface. HtmlToolInstance takes care of creating the ChimeraX tool instance, main window, and HTML widget. Derived classes can also define methods that are called when hyperlinks in the HTML widget are clicked, or when ChimeraX models are added or removed.

The tool_window instance attribute refers to the MainToolWindow instance for the tool.

The html_view instance attribute refers to the HtmlView instance for managing HTML content and link actions.

To facilitate customizing the HTML view, if the derived class has an attribute CUSTOM_SCHEME and a method handle_scheme(), then the HtmlView instance will be configured to support the custom scheme.

If the HtmlToolInstance has a method update_models(), then it will be called as a handler to model addition and removal events. update_models() should take three arguments: self, trigger_name and trigger_data. trigger_name is a string and trigger_data is a list of models added or removed.

Parameters:
session : a Session instance

The session in which the tool is created.

tool_name : a string

The name of the tool being created.

size_hint : a 2-tuple of integers, or ‘’None’‘

The suggested initial widget size in pixels.

delete()

Supported API . Delete this HtmlToolInstance.

ChimeraXHtmlView provides a HTML window that understands ChimeraX-specific schemes. It is built on top of HtmlView, which provides scheme support.

class ChimeraXHtmlView(session, *args, **kw)

Bases: HtmlView

HTML window with ChimeraX-specific scheme support.

The schemes are ‘cxcmd’ and ‘help’.

class HtmlView(*args, size_hint=None, schemes=None, interceptor=None, download=None, profile=None, tool_window=None, log_errors=False, **kw)

Bases: QWebEngineView

HtmlView is a derived class from PyQt5.QtWebEngineWidgets.QWebEngineView that simplifies using custom schemes and intercepting navigation requests.

HtmlView may be instantiated just like QWebEngineView, with additional keyword arguments:

Parameters:
size_hint : a QSize compatible value, typically (width, height),

specifying the preferred initial size for the view. Default None.

interceptor : a callback function taking one argument, an instance

of QWebEngineUrlRequestInfo, invoked to handle navigation requests. Default None.

schemes : an iterable of custom schemes that will be used in the

view. If schemes is specified, then interceptor will be called when custom URLs are clicked. Default None.

download : a callback function taking one argument, an instance

of QWebEngineDownloadItem, invoked when download is requested. Default None.

profile : the QWebEngineProfile to use. If it is given, then

‘interceptor’, ‘schemes’, and ‘download’ parameters are ignored because they are assumed to be already set in the profile. Default None.

tool_window : if specified, ChimeraX context menu is displayed instead

of default context menu. Default None.

log_errors : whether to log JavaScript error/warning/info messages

to ChimeraX console. Default False.

Attributes:
profile : the QWebEngineProfile used
deleteLater()

Supported API . Schedule HtmlView instance for deletion at a safe time.

runJavaScript(script, *args)

Supported API . Run JavaScript using currently displayed HTML page.

Parameters:
script : a string containing URL to new content.
args : additional arguments supported by

:py:method:`PyQt5.QtWebEngineWidgets.QWebEnginePage.runJavaScript`.

setHtml(html, url=None)

Supported API . Replace widget content.

Parameters:
html : a string containing new HTML content.
url : a string containing URL corresponding to content.
setUrl(url)

Supported API . Replace widget content.

Parameters:
url : a string containing URL to new content.
sizeHint()

Supported API . Returns size hint as a :py:class:PyQt5.QtCore.QSize instance.

set_user_agent(profile)

Experimental API . Set profile’s user agent

ui_autostart(session, do_start, tool_name)

Experimental API . Control whether a tool is launched at ChimeraX startup

ui_dockable(session, dockable, tool_name)

Experimental API . Control whether a tool’s windows are dockable

mouse_modes: Mouse modes

Classes to create mouse modes and assign mouse buttons and modifier keys to specific modes.

class MouseEvent(event)

Bases: object

Provides an interface to mouse event coordinates and modifier keys so that mouse modes do not directly depend on details of the window toolkit.

__init__(event)

Experimental API . Initialize self. See help(type(self)) for accurate signature.

alt_down()

Supported API . Does the mouse event have the alt key down.

position()

Supported API . Pair of floating point x,y pixel coordinates relative to upper-left corner of graphics window. These values can be fractional if pointer device gives subpixel resolution.

shift_down()

Supported API . Does the mouse event have the shift key down.

wheel_value()

Supported API . Number of clicks the mouse wheel was turned, signed float. One click is typically 15 degrees of wheel rotation.

class MouseMode(session)

Bases: object

Classes derived from MouseMode implement specific mouse modes providing methods mouse_down(), mouse_up(), mouse_motion(), wheel(), pause() that are called when mouse events occur. Which mouse button and modifier keys are detected by a mode is controlled by a different MauseModes class.

__init__(session)

Supported API .

double_click = None

Supported API . Whether the last mouse-down was actually a double_click. Can be used in the mouse-up event handler if different behavior needed after a double click. There is a mouse_double_click method for doing something on a double click (which happens on the second mouse down), so this boolean is only for mouse-up handlers that behave differently after single vs. double clicks.

enable()

Supported API . Called when mouse mode is enabled. Override if mode wants to know that it has been bound to a mouse button.

icon_file = None

Supported API . Image file name for an icon for this mouse mode to show in the mouse mode GUI panel. The icon file of this name needs to be in the mouse_modes tool icons subdirectory, should be PNG, square, and at least 64 pixels square. It will be rescaled as needed. A none value means no icon will be shown in the gui interface.

last_mouse_position = None

Experimental API . Last mouse position during a mouse drag.

mouse_double_click(event)

Supported API . Override this method to handle double clicks. Keep in mind that you will also receive the mouse_down and mouse_up events. If your mouse_up handler needs to behave differently depending on whether it is the second part of a double click, have it check the self.double_click boolean, and make sure to call this base method so that the boolean is set.

mouse_down(event)

Supported API . Override this method to handle mouse down events. Derived methods can call this base class method to set mouse_down_position and last_mouse_position and properly handle double clicks.

mouse_down_position = None

Experimental API . Pixel position (x,y) of mouse-down, sometimes useful to detect on mouse-up whether any mouse motion occured. Set to None after mouse up.

mouse_motion(event)

Supported API . Return the mouse motion in pixels (dx,dy) since the last mouse event.

mouse_up(event)

Supported API . Override this method to handle mouse down events. Derived methods can call this base class method to set mouse_down_position and last_mouse_position to None.

move_after_pause()

Supported API . Override this method to take action when the mouse moves after a hover. This allows for instance undisplaying a popup help balloon window.

name = 'mode name'

Supported API . Name of the mouse mode used with the mousemode command. Should be unique among all mouse modes.

pause(position)

Supported API . Override this method to take action when the mouse hovers for a time given by the MouseModes pause interval (default 0.5 seconds).

pixel_size(center=None, min_scene_frac=1e-05)

Supported API . Report the pixel size in scene units at the center of rotation. Clamp the value to be at least min_scene_fraction times the width of the displayed models.

wheel(event)

Supported API . Override this method to handle mouse wheel events.

class MouseModes(session)

Bases: object

Keep the list of available mouse modes and also which mode is bound to each mouse button (left, middle, right), or mouse button and modifier key (alt, command, control shift). The mouse modes object for a session is session.ui.mouse_modes

__init__(session)

Experimental API . Initialize self. See help(type(self)) for accurate signature.

add_mode(mode)

Supported API . Add a MouseMode instance to the list of available modes.

bind_mouse_mode(button, modifiers, mode)

Experimental API . Button is “left”, “middle”, “right”, “wheel”, or “pause”. Modifiers is a list 0 or more of ‘alt’, ‘command’, ‘control’, ‘shift’. Mode is a MouseMode instance.

bind_standard_mouse_modes(buttons=('left', 'middle', 'right', 'wheel', 'pause'))

Experimental API . Bind the standard mouse modes: left = rotate, ctrl-left = select, middle = translate, right = zoom, wheel = zoom, pause = identify object.

bindings

Experimental API . List of MouseBinding instances.

mode(button='left', modifiers=[])

Experimental API . Return the MouseMode associated with a specified button and modifiers, or None if no mode is bound.

modes

Experimental API . List of MouseMode instances.

mouse_pause_tracking()

Experimental API . Called periodically to check for mouse pause and invoke pause mode. Typically this will be called by the redraw loop and is used to determine when a mouse pause occurs.

remove_binding(button, modifiers)

Experimental API . Unbind the mouse button and modifier key combination. No mode will be associated with this button and modifier.

remove_mode(mode)

Experimental API . Remove a MouseMode instance from the list of available modes.

mod_key_info(key_function)

Experimental API . Qt swaps control/meta on Mac, so centralize that knowledge here. The possible “key_functions” are: alt, control, command, and shift

Returns the Qt modifier bit (e.g. Qt.AltModifier) and name of the actual key

OptionsPanel and CategorizedOptionsPanel are for interfaces that want to present a set of options that aren’t remembered in any way between different sessions. The corresponding Settings classes offer buttons to Save/Reset/Restore the option values to/from a Settings instance (found in chimerax.core.settings).

The Categorized classes organize the presented options into categories, which the user can switch between.

class CategorizedOptionsPanel(parent=None, *, category_sorting=True, option_sorting=True, **kw)

Bases: QTabWidget

Supported API. CategorizedOptionsPanel is a container for single-use (not savable) Options sorted by category

add_option(category, option)

Supported API . Add option (instance of chimerax.ui.options.Option) to given category

add_tab(category, panel)

Supported API . Only used if a tab needs to present a custom interface.

The panel needs to offer a .options() method that returns its options.

class CategorizedSettingsPanel(parent=None, *, category_sorting=True, option_sorting=True, **kw)

Bases: SettingsPanelBase

Supported API. CategorizedSettingsPanel is a container for remember-able Options that work in conjunction with Options that have Settings instances (found in chimerax.core.settings) specified via their ‘settings’ constructor arg, and that are presented in categories.

add_option(category, option)

Supported API . Add option (instance of chimerax.ui.options.Option) to given category

add_option_group(category, group_label=None, *, sorting=True)

Experimental API . Returns a container widget and an OptionsPanel; caller is responsible for creating a layout for the container widget and placing the OptionsPanel in it, along with any other desired widgets

add_tab(category, panel)

Supported API . Same as CategorizedOptionsPanel.add_tab(…)

class OptionsPanel(parent=None, *, sorting=True, scrolled=True)

Bases: QWidget

Supported API. OptionsPanel is a container for single-use (not savable) Options

add_option(option)

Supported API . Add an option (instance of chimerax.ui.options.Option).

sizeHint(self) → QSize

Experimental API . ..

!! processed by numpydoc !!
class SettingsPanel(parent=None, *, sorting=True, **kw)

Bases: SettingsPanelBase

Supported API. SettingsPanel is a container for remember-able Options that work in conjunction with Options that have Settings instances (found in chimerax.core.settings) specified via their ‘settings’ constructor arg.

add_option(option)

Supported API . Add an option (instance of chimerax.ui.options.Option).

add_option_group(group_label=None, *, sorting=True)

Experimental API . Returns a container widget and an OptionsPanel; caller is responsible for creating a layout for the container widget and placing the OptionsPanel in it, along with any other desired widgets

class SettingsPanelBase(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())

Bases: QWidget

class BooleanOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for true/false values

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class ColorOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: RGBA8Option

Option for rgba colors

class EnumOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for enumerated values

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class FloatOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for floating-point values. Constructor takes option min/max keywords to specify lower/upper bound values. Besides being numeric values, those keyords can also be ‘positive’ or ‘negative’ respectively, in which case the allowed value can be arbitrarily close to zero but cannot be equal to zero.

‘decimal_places’ indicates allowable number of digits after the decimal point (default: 3). Values with more digits will be rounded. If the widget provides a means to increment the value (e.g. up/down arrow) then ‘step’ is how much the value will be incremented (default: 10x the smallest value implied by ‘decimal_places’).

Supports ‘preceding_text’ and ‘trailing_text’ keywords for putting text before and after the entry widget on the right side of the form

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class HostPortOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: StringIntOption

Supported API. Option for a host name or address and a TCP port number (as a 2-tuple)

class IntOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for integer values. Constructor takes option min/max keywords to specify lower/upper bound values.

Supports ‘preceding_text’ and ‘trailing_text’ keywords for putting text before and after the entry widget on the right side of the form

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class Option(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: object

Supported API. Base class (and common API) for all options

enabled

Supported API . Enable/disable the option

get_attribute()

Supported API . Get the attribute associated with this option (‘attr_name’ in constructor) from the option’s settings attribute

make_callback()

Supported API . Called (usually by GUI) to propagate changes back to program

set_attribute()

Supported API . Set the attribute associated with this option (‘attr_name’ in constructor) from the option’s settings attribute

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

value

Supported API . Get/set the option’s value; when set it should NOT invoke the callback

class OptionalRGBA8Option(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Option for 8-bit (0-255) rgba colors, with possibility of None.

Supports ‘initial_color’ constructor arg for initializing the color button even when the starting value of the option is None (checkbox will be unchecked)

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

set_value(value)

Experimental API . Accepts a wide variety of values, not just rgba

class OptionalRGBA8PairOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Like OptionalRGBA8Option, but two checkboxes/colors

Supports ‘initial_colors’ constructor arg (2-tuple of colors) for initializing the color buttons even when the starting value of the option is (None, None) (checkboxes will be unchecked)

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

set_value(value)

Experimental API . 2-tuple. Accepts a wide variety of values, not just rgba

class OptionalRGBAOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: OptionalRGBA8Option

Option for floating-point (0-1) rgba colors, with possibility of None.

Supports ‘initial_color’ constructor arg for initializing the color button even when the starting value of the option is None (checkbox will be unchecked)

class OptionalRGBAPairOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: OptionalRGBA8PairOption

Like OptionalRGBAOption, but two checkboxes/colors

Supports ‘initial_colors’ constructor arg (2-tuple of colors) for initializing the color buttons even when the starting value of the option is (None, None) (checkboxes will be unchecked)

class RGBA8Option(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Option for rgba colors, returns 8-bit (0-255) rgba values

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

set_value(value)

Experimental API . Accepts a wide variety of values, not just rgba

class RGBAOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: RGBA8Option

Option for rgba colors, returns floating-point (0-1) rgba values

class StringIntOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for a string and an int (as a 2-tuple), for something such as host and port

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class StringOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for text strings

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class StringsOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: Option

Supported API. Option for list of plain text strings There is no builtin way for the user to indicate that they are done wditing the text, so no callback will occur. If such an indication is needed, another widget would have to provide it.

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values

class SymbolicEnumOption(name, default, callback, *, balloon=None, attr_name=None, settings=None, auto_set_attr=True, **kw)

Bases: EnumOption

Supported API. Option for enumerated values with symbolic names

make_callback()

Supported API . Called (usually by GUI) to propagate changes back to program

set_multiple()

Supported API . Indicate that the items the option covers have multiple different values