GUI widgets for grouping Controls together and defining layout.
A widget with a text label.
Create a Label with the given text.
- text
- String to appear in the Label
- justify
- Text justification: ‘left’, ‘center’, or ‘right’
- image_file
- Full path to image file. May be in any format that ‘convert’ supports.
- image_width
- Width in pixels to resize the image to
- image_height
- Height in pixels to resize the image to
Width and height may be used to scale the image in different ways:
- width == 0, height == 0
- Preserve the original image’s size
- width > 0, height == 0
- Resize to the given width; height automatically adjusts to maintain aspect ratio
- width == 0, height > 0
- Resize to the given height; width automatically adjusts to maintain aspect ratio
- width > 0, height > 0
- Resize to exactly the given dimensions
Draw the Label in the given master.
A group of Widgets in a rectangular frame, with an optional label.
Create a Panel containing one or more widgets or sub-panels.
Draw the Panel, but not any contained widgets.
- labeled
- True (default) to use a LabelFrame with the panel’s name, False to draw the panel without a label.
Panel subclasses must pack the contained widgets, or call draw_widgets to pack them.
Draw contained widgets in self.frame.
- side
- ‘top’ or ‘left’, to pack widgets on that side
- expand
- True to make widgets fill all available space
Panel subclasses may call this method to pack widgets, or do custom packing (and not call this method).
Enable all widgets in the Panel.
Return a list of all command-line options from contained widgets.
Set panel options from the given list of command-line arguments, and remove any successfully parsed options and arguments from args.
A group of widgets or sub-panels, packed horizontally (left-to-right).
For example:
HPanel("General",
Filename(...),
Flag(...),
Number(...)
)
Create an HPanel to show the given widgets in a horizontal layout.
Draw the HPanel and its contained widgets in the given master.
A group of widgets or sub-panels, packed vertically (top-to-bottom).
For example:
VPanel("General",
Filename(...),
Flag(...),
Number(...)
)
Create a VPanel to show the given widgets in a vertical layout.
Draw the VPanel and its contained widgets in the given master.
A Panel with Controls that are shown/hidden using a dropdown list.
The Dropdowns panel initially displays a single dropdown list, with one entry for each Control. When a dropdown entry is selected, the corresponding Control is displayed, along with a “remove” button to discard the control.
Create and display the chosen control.
Draw the Dropdowns widget in the given master.
Return a list of command-line options from all active Controls.
Remove a given Control from the interface.
A Panel that may be hidden or “closed” like a drawer.
Create a Drawer containing the given widgets.
Draw the Drawer, with contained widgets initially hidden.
Show or hide the widgets in the Drawer.
A Panel with tab buttons that switch between several widgets.
Create a tabbed panel that switch between several widgets.
Display the given tab (either by index or Widget instance).
Event handler for switching tabs
Draw the Tabs widget in the given master.
A Panel that shows a group of several Flag controls, optionally making them mutually-exclusive.
Create a FlagGroup with the given label and state.
- name
- Name/label for the group
- kind
- ‘normal’ for independent Flags, ‘exclusive’ for mutually-exclusive Flags (more like a Choice)
- flags
- One or more Flag controls to include in the group
These keyword arguments are accepted:
- side
- ‘top’ or ‘left’, to pack Flags vertically or horizontally
- rows
- For ‘left’ packing, number of rows to split flags into
- columns
- For ‘top’ packing, number of columns to split flags into
Draw the FlagGroup in the given master widget.
Return a list of arguments for setting the relevant flag(s).
Called when a flag is modified.