2.00 Button
Lokasenna edited this page Jun 24, 2018
·
1 revision
It's a button. You click on it. Things happen.
z Element depth, used for hiding and disabling layers. 1 is the highest.
x, y Coordinates of top-left corner
w, h Button size
caption Label
func Function to perform when clicked.
Note that you only need give a reference to the function:
GUI.New("my_button", "Button", 1, 32, 32, 64, 32, "Button", my_func)
Unless the function is returning a function (hey, Lua is weird), you don't want to actually run it:
GUI.New("my_button", "Button", 1, 32, 32, 64, 32, "Button", my_func())
... Any parameters to pass to that function, separated by commas as they
would be if calling the function directly.
r_func Function to perform when right-clicked
r_params If provided, any parameters to pass to that function
font Button label's font
col_txt Button label's color
col_fill Button color.
If you change this at any time after having run GUI.Init(), call
GUI.elms.my_button:init() so the buffer can be redrawn.
Programmatically force a button-click and run func, i.e. for allowing buttons to have an associated hotkey.
r Boolean, optional. r = true will run r_func instead.
Introduction
- 1. Getting started
- 2. Parts of a basic script
- 3. How it works
- 4. Fonts and colors
- 5. Element methods
Elements
- 1. Button
- 2. Frame
- 3. Knob
- 4. Label
- 5. Listbox
- 6. Menubar
- 7. Menubox
- 8. Options
- 9. Slider
- 10. Tabs
- 11. Textbox
- 12. TextEditor
- 13. Window
Core functions
- 1. Element creation
- 2. GUI variables
- 3. Script hooks
- 4. Table functions
- 5. Text functions
- 6. Color functions
- 7. Math and Logic functions
- 8. Graphics functions
- 9. Element functions
Additional documentation