WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR General Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=172)
-   -   How to build an addon settings panel? (https://www.wowinterface.com/forums/showthread.php?t=59221)

Zax 09-16-22 03:38 AM

How to build an addon settings panel?
 
I'm totally lost in the new way to display the settings of an addon.
I looked at the Vertical Layout example found at https://wowpedia.fandom.com/wiki/Pat....0/API_changes.
Sample code works and it is correclty displayed in my addon setttings panel but I would like to add some simple frames with texts (fontStrings), or simple buttons, to this panel.

Thank you for any help.

Zax 09-16-22 11:06 AM

To be more accurate, I wonder how Combat section title is made in the following screen capture:



Zax 09-17-22 04:35 AM

Using the "Canvas" form for a settings panel, I'm unable to deal with check button:

First, it looks weird:


Second, it doesn't work :(
Lua Code:
  1. local chkButton = CreateFrame("CheckButton", "ChkDarkui", parentFrame, "SettingsCheckBoxControlTemplate")
  2. chkButton:SetPoint("LEFT", subFrame, "RIGHT", 40, 0)
  3. chkButton.Text:SetText("checkbox label ***")
  4. chkButton:SetScript("OnShow", function(self)
  5.     print("show button") -- printed
  6.     self:SetChecked(true) -- seems ignored !!!!!!!!!!!!!!!
  7. end)
  8. chkButton:SetScript("OnClick", function(self)
  9.     print(self:GetChecked(), "check button click TEST")-- nothing happens !!!!!!!!!!!!!!!!!
  10. end)


All times are GMT -6. The time now is 02:14 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI