Summary

A button is a widget that can handle user interaction, such as a mouse click. A button can be in one of the following four states. The |cffee4400Normal|r state is the default state, the |cffee4400Disabled|r state is used for inactive buttons, the |cffee4400Highlight|r state is used when the mouse hovers over the button and the |cffee4400Pushed|r state is used for buttons that are pushed by holding the mouse button down.


The button has all properties and events of a |cffee4400Frame|r.


Properties

ButtonText

Type: |cffee4400FontString|r

Holds the fontstring that is used to draw the button's text and controls the text's initial position. The value of this property is usually inherited from one of the built-in templates.


The following properties exist for the Normal, Disabled and Highlight states:


~Color (ie. NormalColor)

Type: |cffee4400Color|r

The color of the text.


~Font (ie. DisabledFont)

Type: |cffee4400Font|r

The font used for the text.


~Texture (ie. HighlightTexture)

Type: |cffee4400Texture|r

The texture of the button.


PushedTexture

Type: |cffee4400Texture|r

Specifies the texture used when the button is in the Pushed state.


PushedTextOffset

Type: |cffee4400Dimension|r

Specifies the offset by which the button's text is moved when the button is in the Pushed state.


Built-in templates

Use the dropdown to select from the list of built-in templates.





Events

The button has the following events:


OnClick

The Click event is raised when the button is clicked.


Example

The following example demonstrates how a button can handle the OnClick event to print the contents of the edit box to the chat window.