Thread Tools Display Modes
10-17-10, 11:21 AM   #1
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
Hide something

Ok so for some reason I cannot for the life of me remember how to hide a ui element at all time.


I know frame:Hide()

but whenever a event happens it pops back up.

I vaguely remember a else if then to keep it hidden.


if frame:Show()
then
frame:Hide()
else
end


but I just can't think.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
10-17-10, 11:37 AM   #2
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
"frame.Show = frame.Hide" would replace the Show()-function with the Hide() one, so that it can't be shown through the normal call.
"frame.Show = nil" to undo.

if you want to hide Blizz-Events, you could also try to :UnregisterAllEvents() of them. I block the BankFrame for my inventory addon this way.
__________________
« Website | GitHub »

Oh hai!
  Reply With Quote
10-17-10, 11:42 AM   #3
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
i am trying to get rid of the stupid ghost window.

GhostFrame:Hide()

I tried to do a on addon_loaded GhostFrame:UnregisterAllEvents()
but it didint work mabey my code if flawed.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
10-17-10, 12:05 PM   #4
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
UIParent.lua says that the events are handled by UIParent, so UnregisterAllEvents() wouldn't work.

Does GhostFrame.Show = GhostFrame.Hide work? (It should?)

You could also try:
GhostFrame:HookScript("OnShow", function(self) self:Hide() end)
__________________
« Website | GitHub »

Oh hai!
  Reply With Quote
10-17-10, 12:10 PM   #5
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
Cheers,

Yea I checked and it is handled by UIParent.
And for some reason UnregisterAllEvents() did not work? Not sure why thought for a second it was secure or something. But oh well. And naw GhostFrame.show = GhostFrame.hide Also does not work unless I am more tired then i think i am but.


GhostFrame:HookScript("OnShow", function(self) self:Hide() end)

Works wonders.

Thank you.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hide something


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off