View Single Post
10/22/14, 06:17 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by circonian View Post
In a LibAddonMenu checkbox is there a function to get a true/false value to see if it is checked or not without grabbing the checkbox:GetText() and comparing it to controls checktedText to see if they match? Its a value I didn't want to save. I just wanted to read it when the user presses a button while the panel is still open and then I don't need it anymore.
You can provide getFunc/setFunc handlers that will tie checkbox status to a variable.

Lua Code:
  1. local g_checked = false
  2.  
  3. local checkboxData = {
  4.    ...
  5.    getFunc = function() return g_checked end,
  6.    setFunc = function(value) g_checked = value end,
  7. }

Originally Posted by circonian View Post
While I'm at it, since LibAddonMenu controls aren't created until the panel is open is there a way to know when the controls are created so you can change the CheckedText/UncheckedText ?
Lua Code:
  1. -- hope it's correct syntax
  2. CALLBACK_MANAGER:RegisterCallback("LAM-PanelControlsCreated", handler)
  Reply With Quote