Curious, frame won't hide
The code below is the only code in an addon I started for a test. The texture is a .blp but setting to a non-existant green square makes no difference.
Does anyone have any idea why this one frame is the only UI element that doesn't hide when I Alt-Z? See. Code:
local button = CreateFrame("Button", "FauxMazzleAssist") |
Probably not parented to UIParent
|
^ That is the correct answer
Quote:
|
Seriously? Parent being an optional parameter of CreateFrame (unless I've missed something) should automatically revert to UIParent (nil).
If I'm wrong then just what/who is the parent of a nil declared frame? |
No. You need a lot of event handlers. All of those would rest on UIParent too.
|
Alt-Z needs event handlers to hide a frame. My event handlers need to rely on UIParent? I'm getting more confused.
I'm not disrespecting Zork, I'm just not understanding where you're comming from which is probalbly on me. |
I have been schooled. Explitily adding UIParent to the CreateFrame function hdes the frame with Alt-Z.
Thank you to Zork and Rilgamon. My question now is, who is the parent of a frame without that specific declration? |
You create it from a template :) So my guess is WorldFrame ... not at home to test it :)
|
local button = CreateFrame("Button", "FauxMazzleAssist")
No template involved. Create a "Button" with the name "FauxMazzleAssist". |
Frames without a parent are mostly used for event handling puposes. They need no parent. And if you call frame:GetParent() it wil probably return nothing.
eventHandler Lua Code:
timer Lua Code:
If you have a frame that should have an visual impact on the game world it has to be part of UIParent (for the sake of ui scaling alone). Some stuff needs to reside on WorldFrame but that is out of my reach. Semlar could probably tell you more. Of course the parent to UIParent is only needed for the first frame of your stack. frame stack Lua Code:
|
The more I think I know, the more it turns out I don't. I was under the assumtion that UIParent was the default.
Thank you both. |
All times are GMT -6. The time now is 02:36 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI