button

button Adds/removes/changes user definable buttons
Usage
button [-d] [-q] (<type_unused:variant>,<name:string>[,<image_id:string>[,<label_text:string>]]) { <callback_code> }
Description
Adds a new user defined button with the specified <name>. The <type_unused> parameter is ignored and is present only for backward compatibility. The button image is specified by the <image_id>. The optional button text is specified by <label_text>. The <callback_code> will be executed as reaction to a button press. The window type button can be added only to the windows that have a button container: this actually includes at least console, channels and queries. The button is added to the current window; if you want to add it to a different window, use the standard -r command rebinding switch. The <callback_code> will be executed as reaction to a button press; the code execution will be bound to the window that the button is attached to. If a button with <name> already exists in the current window, its parameters are changed according to the passed values (<image_id>, <label_text> and <callback_code>). Passing an empty <callback_value> removes the button. The callback parameters $0 and $1 will contain the screen coordinates of the bottom-left corner of the button: this is useful for showing a popup menu in response to the click. If the -q switch is used, this command prints no warnings. The -d switch causes the button to be disabled (grayed).
Switches
-d | --disabled
Creates the button as disabled
-q | --quiet
Run quietly, print no warnings
Examples
button(w,test,-1,Test button){ echo Test!; } button(w,test){}

Index, Commands