# button

Adds/removes/changes user definable buttons

Syntax

    button [-d] [-q] (<type>,<name>[,<image_id>[,<label_text>]])
    {
        <callback_code>
    }

Description

Adds a new user defined button with the specified <name>.
The button <type> must be one of the constants "toolbar" and "window".
"toolbar" stands for frame-wide toolbar button "window" stands for window button.
The <type> constants may be abbreviated (even to the letters 't','c' and 'w').
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 frame-wide buttons have their callback_code executed in the active window (thus are not bound to any IRC context) and are ALWAYS visible.
The IRC context specific buttons have their callback_code executed in the console of the IRC context that they are bound to, and may be not visible if the IRC context is not the current one.
If a button with <name> already exists in the current IRC context (or frame window for frame wide buttons), its parameters are changed according to the passed values (<image_id>, <label_text> and <callback_code>).
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 attacched 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).

Examples

        button(t,test,-1,Test button){ echo Test!; }
        button(t,test){}

Main, Commands

KVIrc 3.0.0 Documentation
Generated by root at Sat Oct 16 22:01:45 2004