-
Notifications
You must be signed in to change notification settings - Fork 43
Radio
Radios are objects, where the user can choose between different items.
Here is a example of how to create a standard radio:
local mainFrame = CreateFrame("myFirstFrame"):show()
local aRadio = mainFrame:addRadio("myFirstRadio"):show()
This will create a default radio on position 1 1 (relative to its parent frame), the default background is colors.lightBlue, the default text color is colors.black and the default zIndex is 5.
Here are all possible functions available for radios. Remember radio inherit from object:
Adds a item to the radio
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
local aRadio = mainFrame:addRadio("myFirstRadio"):show()
aRadio:addItem("1. Entry")
aRadio:addItem("2. Entry",5,1,colors.yellow)
aRadio:addItem("3. Entry",5,4,colors.yellow,colors.green)
args: text, x, y bgcolor, fgcolor, ..., text is the displayed text, x and y are the position, where you want the item to be created, bgcolor and fgcolors the colors of background/text and args (...) is something dynamic, you wont see them but if you require some more information per item you can use that.
returns: the object
Removes a item to the radio
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
local aRadio = mainFrame:addRadio("myFirstRadio"):show()
aRadio:addItem("1. Entry")
aRadio:addItem("2. Entry",colors.yellow)
aRadio:addItem("3. Entry",colors.yellow,colors.green)
aRadio:removeItem(2)
args: item table (you can get with :getValue()) OR item index
returns: the object
changes the selected symbol
local mainFrame = CreateFrame("myFirstFrame"):show()
local aInput = mainFrame:addInput("myFirstInput"):setInputType("password"):show()
args: char
returns: the object
Thanks for checking out our wiki, join our discord for more help: discord.gg/yM7kndJdJJ