Thread Tools Display Modes
10-14-05, 07:52 PM   #1
Vex
Premium Member
 
Vex's Avatar
Join Date: Sep 2005
Posts: 41
FrameExists() / IsAddonLoaded()

is there a way to see if a frame exists?

I tried using http://www.wowwiki.com/API_IsAddOnLoaded
Code:
	if (IsAddonLoaded("DiscordActionBars") == 1) then
	info = {};
	info.text = "Discord Action Bars";
	info.value = "DAB_Options";
	info.notCheckable = 1;
	info.func = function() ShowFrame_OnClick(DAB_Options) end;
	UIDropDownMenu_AddButton(info);
	end
but it returns the error:
attempt to call global 'IsAddonLoaded' (a nil value)

what am i doin wrong?

Last edited by Vex : 10-14-05 at 07:58 PM.
  Reply With Quote
10-14-05, 08:03 PM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
IsAddOnLoaded : capitalize the O.

Generically, if a frame exists it will be a table instead of nil.

if SomeModsFrame1 then
-- frame exists
end

Lots of times when I forget the name of a frame or function, I'll do /script message(IsAddOnLoaded) and it will say table or function or nothing for nil. (well, specifically I have in my startup: function print(v1) DEFAULT_CHAT_FRAME:AddMessage(v1 or "nil") end, and use print instead of message.
  Reply With Quote
10-14-05, 08:38 PM   #3
Vex
Premium Member
 
Vex's Avatar
Join Date: Sep 2005
Posts: 41
oh. ha. thanks :P

obviously i've been staring at code for too long
  Reply With Quote
10-17-05, 10:54 AM   #4
Atrius
A Murloc Raider
Join Date: Jul 2005
Posts: 5
Actually this is incorrect on wowwiki as well heh, I noticed the same thing.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » FrameExists() ?


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