8.13.35 Functions defined in the widgets module

selectFont( )
Ask the user to select a font.

A font selection dialog widget is displayed and the user is requested to select a font. Returns a font if the user exited the dialog with the OK button. Returns None if the user clicked CANCEL.

getColor( col=None,caption=None)
Create a color selection dialog and return the selected color.

col is the initial selection. If a valid color is selected, its string name is returned, usually as a hex #RRGGBB string. If the dialog is canceled, None is returned.

dialogButtons( dialog,actions,default)
Create a set of dialog buttons

dia is a dialog widget actions is a list of tuples (name,) or (name,function). If a function is specified, it will be executed on pressing the button. If no function is specified, and name is one of 'ok' or 'cancel' (case does not matter), the button will be bound to the dialog's 'accept' or 'reject' slot. default is the name of the action to set as the default.

messageBox( message,level='info',choices=['OK'],timeout=None)
Display a message box and wait for user response.

The message box displays a text, an icon depending on the level (either 'about', 'info', 'warning' or 'error') and 1-3 buttons with the specified action text. The 'about' level has no buttons.

The function returns the text of the button that was clicked or an empty string is ESC was hit.

textBox( text,type=None,choices=['OK'])
Display a text and wait for user response.

Possible choices are 'OK' and 'CANCEL'. The function returns True if the OK button was clicked or 'ENTER' was pressed, False if the 'CANCEL' button was pressed or ESC was pressed.

normalize( s)
Normalize a string.

Text normalization removes all '&' characters and converts to lower case.