-
Posted by _whelp on Wed, 16 Dec 2009 04:33:43
Everything works except that the EventHandle function isn't even run... I think there's something wrong with the event...
Why isn't it working?
IgnoreDuel = {} IgnoreDuel.Frame = CreateFrame("Frame", nil, UIParent) IgnoreDuel.CheckButton = CreateFrame("CheckButton", nil, IgnoreDuel.Frame) IgnoreDuel.Text = IgnoreDuel.Frame:CreateFontString() IgnoreDuel.CheckButton:SetWidth("25") IgnoreDuel.CheckButton:SetHeight("25") IgnoreDuel.Frame:SetWidth("132") IgnoreDuel.Frame:SetHeight("60") IgnoreDuel.Text:SetFontObject(GameFontNormal) IgnoreDuel.Text:SetPoint("CENTER", IgnoreDuel.Frame, "CENTER", 0, 12) IgnoreDuel.CheckButton:SetPoint("CENTER", IgnoreDuel.Frame, "CENTER", 0, -12) IgnoreDuel.Frame:SetPoint("TOP", UIParent, "TOP", 0, -72) IgnoreDuel.CheckButton:SetNormalTexture("Interface\\Buttons\\UI-CheckBox-Up") IgnoreDuel.CheckButton:SetPushedTexture("Interface\\Buttons\\UI-CheckBox-Down") IgnoreDuel.CheckButton:SetHighlightTexture("Interface\\Buttons\\UI-CheckBox-Highlight", "ADD") IgnoreDuel.CheckButton:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check") IgnoreDuel.Text:SetText("Toggle Duel Ignore") IgnoreDuel.Frame:SetBackdrop( { bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], tile = true, tileSize = 16, edgeSize = 16, insets = { left = 5, right = 5, top = 5, bottom = 5 } }) IgnoreDuel.Frame:SetBackdropColor(.75, .75, .75, .75) IgnoreDuel.Frame:SetBackdropBorderColor(1, 1, 1, 1) function IgnoreDuel.EventHandle(self, event, ...) if(event == "DUEL_REQUESTED") then if(IgnoreDuel.CheckButton:GetChecked() == true) then CancelDuel() end end end IgnoreDuel.Frame:RegisterEvent("DUEL_REQUESTED") IgnoreDuel.Frame:SetScript("OnEvent", EventHandle)
-
Posted by jnwhiteh on Wed, 16 Dec 2009 09:01:28
It's possible. Add a print statement to your event handler to see if it's being called. YOu can also use /eventtrace to see what events are firing.
-
Posted by _whelp on Wed, 16 Dec 2009 16:27:30
I put print in the event handler, it didn't show the print.
EDIT: I forgot the . prefix before the EventHandle, it works now.