Wowpedia
Advertisement
Wowpedia
240,483
pages

Buttons, EditBoxes and Sliders each implement similar methods to enable or disable user interaction. These widgets also appear frozen (greyed out) while disabled, but Button provides several methods to tweak its disabled behaviour.

Button:SetEnabled(enabledFlag)
Button:Enable()
Button:Disable()

EditBox:SetEnabled(enabledFlag)
EditBox:Enable()
EditBox:Disable()

Slider:SetEnabled(enabledFlag)
Slider:Enable()
Slider:Disable()

Arguments

enabledFlag 
Boolean (SetEnabled only) - true equates to Enable() and false equates to Disable()

Patch changes

  • Mists of Pandaria Patch 5.0.4 / API (2012-08-28): SetEnabled(boolean) added.[1]
    Previously only Enable() and Disable()

See also

  • Button:IsEnabled, EditBox:IsEnabled and Slider:IsEnabled - Returns whether the widget is currently interactive
  • Button:SetNormalTexture and Button:SetDisabledTexture - Controls how a button changes its appearance while enabled or disabled
  • Button:SetNormalFontObject and Button:SetDisabledFontObject - Controls how a button's label changes its appearance while enabled or disabled
  • Button:SetMotionScriptsWhileDisabled - Controls whether a button responds to OnEnter and OnLeave events while disabled

References

 
  1. ^ 2012-08-21, PVEFrame.lua, version 5.0.4.16016, near line 127, archived at Townlong-Yak
Advertisement