Component

Component is an abstract superclass for most Thinlet widgets. All components support the parameters listed below.

Properties
NameTypeDefaultDescription
namestring Identifies the component.
enabledbooleantrueEnables or disables this component. A disabled component is painted gray, and can't respond to user mouse or keyboard input, gain the keyboard focus, and generate events.
visiblebooleantrueAn invisible component doesn't take place in parent's layout.
tooltipstring The text pops up when the mouse lingers inside the component.
fontfont Custom font for texts.
foregroundcolor Custom foreground (text) color to use, instead of the default text color.
backgroundcolor Custom background color to use, instead of the default background color. Note: for components with gradients (buttons, menubars, etc...) this means that the background will be filled with solid color, and not a custom gradient.
widthinteger0Fixed preferred width of the component irrespectively of its content. If it is 0, the component will be asked for the preferred width.
heightinteger0Preferred height of the component, or 0.
colspaninteger1Specifies the number of cells in a column in the component's display area.
rowspaninteger1Specifies the number of cells in a row occupied by the component.
weightxinteger0Used to determine how to distribute horizontal space among grid cells when more space is available for its parent component than required.
weightyinteger0The extra vertical space is distributed to each cell height in proportion to its weight. Default value is 0. The row contains 0 weighted components remains the calculated preferred size.
halignchoicefillHorizontal alignment of the component when more space available in the cell. Possible values are: fill, center, left, and right.
valignchoicefillVertical alignment in the cell. Possible values are: fill, center, top, and bottom.
propertyproperty Binds an arbitrary key/value client property (or properties).
Listeners
NameDescription
initA method to invoke only once when the loading of the xml resource (including this component) is finished.
focuslostInvoked when a component loses the keyboard focus, thus it is no longer the focus owner.
focusgainedInvoked when a component gains the keyboard focus, thus it is now the focus owner.

PopupMenu

Popup menus resemble in functionality normal menus, and can be added to most components. Popupmenu component can have the same sub-components as menu. Popup menus are invoked with mouse right-click.

Properties
NameTypeDefaultDescription
name, enabled, visible, tooltip, and property parameters are similar to component
Listeners
NameDescription
menushownThis method is called after the popup menu becomes visible.