|
Contents
TwBar commands syntaxDescriptionThis page decribes the bar commands allowed in the def string of function TwDefine, and their syntax. TwDefine(" barName barCommand1 barCommand2 ... ");
where Bar commandslabelSyntax
DescriptionChanges the label of a bar, that is the title displayed on top of a bar. By default, the label is the name used when the bar was created. ExampleTwDefine(" mybar label='Engine properties' "); helpSyntax
DescritpionDefines the help message associated to a bar. This message will be displayed inside the Help bar automatically created to help the user.
You can also define a global help message. It will be displayed at the beginning of the Help bar. To define it, use the ExampleTwDefine(" mybar help='These properties defines the engine behaviour' "); TwDefine(" GLOBAL help='I can write here a general description of my program.\n Welcome happy users!' "); colorSyntax
DescriptionChanges the color of a bar. By default this color is chosen randomly.
To ensure good contrast between bar text and background, the red/green/blue color is not used directly. Instead, it is converted to a hue/lightness/saturation color and only the hue and saturation components are used; the lightness is adjusted to get good visual. ExampleTwDefine(" mybar color='50 0 0 255' "); // semi-transparent blue bar TwDefine(" mybar color='128 128 0' "); // opaque yellow bar positionSyntax
DescriptionMove a bar to a new position.
ExampleTwDefine(" mybar position='200 40' "); // move bar to position (200, 40) sizeSyntax
DescriptionChange the bar size.
ExampleTwDefine(" mybar size='240 320' "); // resize bar valuesWidthSyntax
DescriptionChange the width of the bar right column used to display numerical values.
ExampleTwDefine(" mybar valuesWidth=120 "); // set values column width fontSizeSyntax
DescriptionChange the size of the font used by the bars.
ExampleTwDefine(" GLOBAL fontSize=3 "); // use large font refreshSyntax
DescriptionChange the refresh rate of the bar.
Values displayed by a bar are automatically updated to reflect changes of their associated variables. ExampleTwDefine(" mybar refresh=1.5 "); // refresh the bar every 1.5 seconds show / hide / iconifySyntax
DescriptionShow, hide or iconify the tweak bar. ExampleTwDefine(" mybar iconify "); // mybar is iconified TwDefine(" mybar hide "); // mybar is hidden TwDefine(" mybar show "); // mybar is displayed again iconPosSyntax
DescriptionChanges the place where icons of iconified bars are displayed.
Note that this command is applied to all bar icons. You can use the ExampleTwDefine(" GLOBAL iconPos=bottomright "); // icons go to bottom-right corner of the window iconAlignSyntax
DescriptionChanges the alignment of icons of iconified bars. It can be vertical (the default), or horizontal.
Note that this command is applied to all bar icons. You can use the ExampleTwDefine(" GLOBAL iconAlign=horizontal "); // icons will be aligned horizontally iconMarginSyntax
Description
Add a margin between borders of the window and icons of iconified bars.
Note that this command is applied to all bar icons. You can use the ExampleTwDefine(" GLOBAL iconMargin='8 16' "); // icons will be displayed at 8 and 16 pixels from the horizontal and vertical window borders respectively NotesNote on string parameters
If a command requires a Examples:
param=Simple // -> Simple
param='Two words' // -> Two words
param=`That's All Folks` // -> That's All Folks
param='He says "Hello!"' // -> He says "Hello!"
// note that in a c-string " are replaced by \" ie.: " param='He says \"Hello!\"' "
param="'aa'-"`"bb"-`'`cc`' // -> 'aa'-"bb"-`cc`
// note that in a c-string " are replaced by \" ie.: " param=\"'aa'-\"`\"bb\"-`'`cc`' "
Note on case sensitivity
See also |