WoW:UIOBJECT ColorSelect: Difference between revisions
Jump to navigation
Jump to search
(Added all I've learned from the last three hours of trying to get a colorSelect widgit working.) |
m (Move page script moved page UIOBJECT ColorSelect to UIOBJECT ColorSelect without leaving a redirect) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{widget}} | |||
If you want to use a ColorSelect widget, you may want to consider using the [[Using the ColorPickerFrame]]. This is a frame already defined by Blizzard. You can display it by calling: ColorPickerFrame:Show() | If you want to use a ColorSelect widget, you may want to consider using the [[Using the ColorPickerFrame]]. This is a frame already defined by Blizzard. You can display it by calling: ColorPickerFrame:Show() | ||
Line 6: | Line 8: | ||
* ColorPickerFrame.cancelFunc() | * ColorPickerFrame.cancelFunc() | ||
== | == Examples == | ||
:ColorPickerFrame.func = my_cpf_func; | :ColorPickerFrame.func = my_cpf_func; | ||
:ColorPickerFrame.opacityFunc = my_cpf_opacityfunc; | :ColorPickerFrame.opacityFunc = my_cpf_opacityfunc; | ||
Line 28: | Line 29: | ||
:: -- called when the user clicks the "Cancel" button that is on the ColorPickerFrame | :: -- called when the user clicks the "Cancel" button that is on the ColorPickerFrame | ||
:end | :end | ||
[[Category:World of Warcraft API]] |
Latest revision as of 04:49, 15 August 2023
If you want to use a ColorSelect widget, you may want to consider using the Using the ColorPickerFrame. This is a frame already defined by Blizzard. You can display it by calling: ColorPickerFrame:Show()
However, displaying it is not enough. You also need to define three functions:
- ColorPickerFrame.func()
- ColorPickerFrame.opacityFunc()
- ColorPickerFrame.cancelFunc()
Examples[edit]
- ColorPickerFrame.func = my_cpf_func;
- ColorPickerFrame.opacityFunc = my_cpf_opacityfunc;
- ColorPickerFrame.cancelFunc = my_cpf_cancelfunc;
- function my_cpf_func()
- print( "my_cpf_func()");
- -- called when any member function is called on a ColorPickerFrame object
- -- called numerous times when a point is clicked on the color wheel
- -- called numerous times when a point is clicked on the shader bar
- end
- function my_cpf_opacityfunc()
- print("my_cpf_opacityfunc()");
- -- called when the user clicks the "Okay" button that is on the ColorPickerFrame
- end
- function my_cpf_cancelfunc()
- print("my_cuf_cancelfunc()");
- -- called when the user clicks the "Cancel" button that is on the ColorPickerFrame
- end