Lore archive · Warcraft Wiki, 2023 dump
UIOBJECT Slider
Last wiki revision 2022-05-26
For class hierarchy and method listing, see main listing here: Widget API Slider.
local MySlider = CreateFrame("Slider", "MySliderGlobalName", ParentFrame, "OptionsSliderTemplate")
Width and height are handled the same as any other widget: MySlider:SetWidth(20) MySlider:SetHeight(100)
To set your slider to a vertical orientation: MySlider:SetOrientation('VERTICAL') Or for a horizontal slider: MySlider:SetOrientation('HORIZONTAL')
Events fired by the widget for which you can set handlers are listed here.
Some special objects are created when using the "OptionsSliderTemplate" template during initialization (CreateFrame). You can access these objects using their global names, as outlined below (as of patch 4.3, these fields have no "parentKey" attribute):
MySlider.tooltipText = 'This is the Tooltip hint' -- Creates a tooltip on mouseover. _G[MySlider:GetName .. 'Low']:SetText('1') -- Sets the left-side slider text (default is "Low"). _G[MySlider:GetName .. 'High']:SetText('100') -- Sets the right-side slider text (default is "High"). _G[MySlider:GetName .. 'Text']:SetText('5') -- Sets the "title" text (top-centre of slider).
These are useful shortcuts in lieu of having to manually define font strings. The "OptionsSliderTemplate" is defined in FrameXML/OptionsPanelTemplates.xml for further reference.
After all that you can show your slider using: MySlider:Show
Categories
- Widgets
Source
https://warcraft.wiki.gg/wiki/UIOBJECT_Slider · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.