The InspectFrame cannot be a parent frame?
Hi,
I'd like to use the InspectFrame as a parent frame, but I can't seem to anchor anything to it. I want my add-on to appear when u /inspect another player. Any idea why this is not possible? Is there anything else I can do? Code:
<Frame name="PPViewFrame" parent="InspectFrame" topLevel="true" enableMouse="true"> </Frame> |
Is the InspectFrame created yet when you are running your code?
|
The InspectFrame is part of the internal addon Blizzard_InspectUI and is only loaded on demand, thus when you first open it.
So, when your frame is created, it doesn't find the InspectFrame, because it simply does not exist at the time. You have to watch when Blizzard_InspectUI is loaded / the InspectFrame is created and then parent your frame to it. Either by using PPViewFrame:SetParent(InspectFrame) or just creating your frame when the InspectFrame is loaded. You could do this by hooksecurefunc'ing "InspectFrame_LoadUI" (called to load the InspectUI), "InspectUnit" (called every time an unit is inspected. Or you just let your addon completely load with the InspectUI, depends on what you want to do with it. You'd have to add these in the .toc: LoadOnDemand: 1 LoadWidth: Blizzard_InspectUI |
Quote:
|
I decided I'm not going to use the InspectFrame as a parent, for it is too hard for me to work around as a beginning add-on author.
However thank you very much for your help, for pointing out to me how it could be done. :) |
All times are GMT -6. The time now is 01:16 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI