Can I make options dialog by using code?
I need to create window with several checkboxes (like PowerAuras options dialog but simplier). I expected to do this using CreateFrame(), but the following code doesn't work at all:
Code:
function OpenSettingsFrame() Second, if I change "FontString" just to "Frame", the code generates no errors but doesn't work - checkboxes do not appear. At the same time, RecommendOptionsFrame is shown correctly (I see it on screen). And third, I have questions :) : 1. How to make frame with text using code? 2. Why checkboxes don't appear? 3. Which addon does create its GUI using code? (that I can inspect). |
Font strings are not "frames", but "regions", and they're created differently, using frame:CreateFontString().
Frames are essentially no more than anchor points as far as visuals go. You need to somehow use textures to get something visible. |
Why not check and see how "PowerAuras" does this? Actually, you can check quite a few addons that have an option screen. Many addons now use an option screen in the "AddOns" tab of Blizzard's default options.
|
Quote:
|
Quote:
Code:
f = RecommendOptionsFrame:CreateFontString("abc", "OVERLAY", "GameFontNormal") Code:
<Layers> |
Hi!
It seems that you haven't anchored the FontString-object to anything. Try something like Code:
f:SetPoint("CENTER",nil,"CENTER",0,0) Odjur |
Also, you have to explicitly tell it to be shown. Frames/regions are shown by default when created.
|
Quote:
I also discovered why my checkboxes don't appear - I forgot to add 4-th function parameter: template. |
If you don't want your objects to inherit from a pre-defined template, then you're going to have to do that work on your own. (Size, position, texture, font, etc.)
|
All times are GMT -6. The time now is 10:04 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI