View Single Post
10/22/14, 07:06 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
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.

I looked through the LibAddonMenu code but it looks like all it does is toggle the SetText(..) unless I'm missing something.
I don't know what you mean by this "when the user presses a button while the panel is still open". If what merlight provided you with is not what you are looking for, then no. There is no GetValue method, as settings are usually supposed to be saved to a saved variable. Even if you don't want to save the value to your saved variables file, you should still save it to *some* variable if you want to access it later.

Edit:
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 ?
Yes, register for the "LAM-PanelControlsCreated" callback, which merlight also provided above. The arg passed through is the panel whose controls are now available.
  Reply With Quote