-
-
Notifications
You must be signed in to change notification settings - Fork 8
TextureDropdown
Jaliborc edited this page Jul 18, 2012
·
4 revisions
TextureDropdown is a frame class which provides dropdowns for selecting textures or backdrops. Inherits from Dropdown. Uses Group and TextureButton for the line listing.
Name | Description |
---|---|
AddLine(value, file [,tip]) | Adds a new line to the dropdown, identified by "value". If a line with the same value already exists, replaces it. If "file" is not provided, "value" will be used as the texture file path (string) or backdrop (table) to be displayed. If "tip" is set, a mouse-hover tooltip will be provided for the tab. |
GetButtonSize() | Returns the width and height (single value) of the displayed TextureButtons. |
myDrop = SushiDropdown()
myDrop:SetLabel('Choose a Texture')
myDrop:AddLine(1, 'Interface//AddOns//MyAddon//SomeTexture.tga')
myDrop:AddLine('Interface//AddOns//MyAddon//OtherTexture.tga')
myDrop:AddLine(2, {
bgFile = 'Interface\\DialogFrame\\UI-DialogBox-Background-Dark',
edgeFile = 'Interface\\DialogFrame\\UI-DialogBox-Border',
},
'Dialog Border')
myDrop:SetCall('OnInput', function(myDrop, value)
if value == 1 then
print("Some texture was selected.")
elseif value == "Interface//AddOns//MyAddon//OtherTexture.tga" then
print("Another texture was selected.")
elseif value == 2 then
print("You have selected a nice dialog border.")
end
end)
This is the Sushi-3.1 wiki. Wiki Home