Thread Tools Display Modes
08-29-07, 12:31 PM   #1
dfscott
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 4
noob modder getting frustrated with CreateFrame

I've struggled with this for a few days and I'm getting really frustrated, so maybe someone here can help (or point me in the right direction). I'm trying to create a FuBar plugin that displays something in a window (frame) when the user clicks a tool tip and/or an option menu (I can't get either to work).

I started with XML files (using the Faraframes tutorial) but couldn't get that to work. I eventually dropped back to using CreateFrame just to try and get *anything* to display! I either get a) nothing happening (except for my debug messages) or b) an error about SetOwner (due to a nil value). I have never been able to get any window at all to display.

Here's a snippet of the current code -- I've tweaked it several different ways based on code I've dug out of other addons, but I 'm thinking that there's something else I'm missing. And I *am* a Java/jsp/php developer, so I'm not a total idiot (which makes this all the more frustrating).

Typical Fubar/Ace2 tooltip code:
Code:
ALG = AceLibrary("AceAddon-2.0"):new("FuBarPlugin-2.0", "AceConsole-2.0")
ALG.hasIcon = "Interface\\AddOns\\ALevelGuide\\guide"
ALG.cannotDetachTooltip = true
ALG.clickableTooltip = true

local Tablet = AceLibrary("Tablet-2.0")

function ALG:OnTooltipUpdate()
    local cat = Tablet:AddCategory();
    local line = cat:AddLine('text',"Test1", "func", "Show 1", "arg1", self, "arg2", 1);
    line = cat:AddLine('text', "Test2");
    Tablet:SetHint("Click me! \nIf you know what's good for ya!")
end
Generic click Handler

Code:
function ALG:ShowGuide(guideNumber)
 self:Print("Generic Showguide called") 
 self:CreateAWindow()
 self:ShowText("back from CAW")
end
Code to actually show the frame:

Code:
function ALG:CreateAWindow()
    local f = CreateFrame("Frame","ALGFrame",Tablet20Frame, "GameTooltipTemplate");
    ALGFrame:SetOwner(Tablet20Frame,"ANCHOR_NONE");
    ALGFrame:SetScale(Tablet:GetFontSizePercent(FuBar.db.profile.tooltip));
    ALGFrame:ClearAllPoints();
    ALGFrame:AddLine("Sample text");
     ALGFrame:Show();
     self:Print("end of CreateA Window");

end
All this code resides in a single main.lua file and it's definitely getting run since the chat outputs are showing up.

Any and all help is appreciated.
  Reply With Quote
08-29-07, 01:21 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I'm not really a coder, but here's the wiki if you haven't seen it yet
http://wowace.com/wiki/Category:Libraries

You can also get on irc (either for wowi or wowace) and get help there.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-29-07, 01:43 PM   #3
dfscott
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 4
Originally Posted by Seerah
I'm not really a coder, but here's the wiki if you haven't seen it yet
http://wowace.com/wiki/Category:Libraries

You can also get on irc (either for wowi or wowace) and get help there.
Thanks for the help.

Unfortunately they had a crash recently and lost a lot, so much of what is there is just bare-bones without any examples or legacy doc. =(

I may just rip out all my old addons and try without anything else running...
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » noob modder getting frustrated with CreateFrame


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