gui.widgets — Contains GUI-related utility functions

Widget Creation

gui.widgets.createPanel(*children, **keywords)
Creates a gtk.Alignment that contains the given widgets (in a gtk.VBox if there is more than one widget) and sets the border width and spacing between widgets to PANEL_BORDER_WIDTH and PANEL_SPACING, respectively. Any keyword arguments are passed to gtk.Alignment().
gui.widgets.createCellDataRounder(index, fractionalDigits=2, trimTrailingZeros=False)
Returns a cell data function for use in a gtk.TreeViewColumn that shows rounded floating-point numbers. The function retrieves its data from column index of the gtk.TreeModel used by the gtk.TreeView the gtk.TreeViewColumn is part of. The retrieved number is then rounded using util.stringFromFloat(), which is called with fractionalDigits and trimTrailingZeros as arguments.
gui.widgets.addMenuItem(menu, text, stock, callback, *parameters)
Adds a gtk.ImageMenuItem to the given gtk.Menu using the given text and the icon from the given stock. Also adds callback to the handlers for the menu item’s activate signal with the given extra parameters.

Utility Functions

gui.widgets.getColor(spec)

Given a color specification which may be either an X11 color name ('misty rose') or a hexadecimal string ('#FFE4E1'), returns a gtk.gdk.Color object matching that specification.

spec may also be a gtk.gdk.Color object, in which case it is returned.

Constants

gui.widgets.PANEL_BORDER_WIDTH
The application-standard width for borders around panels.
gui.widgets.PANEL_SPACING
The application-standard width for the spacing between widgets in a panel.

Table Of Contents

Previous topic

gui.mediator

Next topic

gui.calibration