Syntax: zs.makebutton{prop-list}

Creates a new button or modifies an existing button and returns the Button record. This uses the Lua class syntax of {prop-list} where {prop-list} is a table of property values. Some properties can be set by the index (position in the table), while other properties can be set by name.

The indexed properties are: Caption, Value/Script, Class, and Name/ID. So, for example:

a = zs.makebutton{"mycaption", "commands", "myclass", "mybutton"}

will create an button called "mybutton" in the class folder "myclass" with the "commands" as the value/script of the button and "mycaption" as the caption. This same button could have been created with the syntax:

a = zs.makebutton{caption="mycaption", value="commands", class="myclass", name="mybutton"}

This key=value syntax allows you to set *any* of the properties of Button object at creation time directly.

For example, you can do this:

b = zs.makebutton{"test", "#show clicked", offcol=255, transparent=false}

This creates a button with a caption of "test". When clicked it displays "clicked" to the window. The color of the button is red (TeSSH uses BGR colors, so 255 is full red). Turning off the Transparent property is needed to force the button to be displayed in red.

Add comment

Login or register to post comments