Thread Tools Display Modes
07-17-05, 02:38 AM   #1
EyesMcFly
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 3
un/registering events

I have a disable/enable command in my mod.

I have set it up so that when you enable it,
the necessary events are registered.

And when you disable it the events are unregisterd.

The problem is this isn't working.

The events are not actually registering or unregistering.

Is it impossible to 'hot' register/unregister events like this?
  Reply With Quote
07-17-05, 05:14 AM   #2
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
Yes, definitely possible -- recommended even.

Gotta see your code to know the problem though.
  Reply With Quote
07-18-05, 02:16 AM   #3
EyesMcFly
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 3
Actually I figured out the problem.

I had:

Code:
function enable()
		this:RegisterEvent(the event);
end
Changing it to:

Code:
function enable()
		MyFrameName:RegisterEvent(the event);
end
Fixed it.
  Reply With Quote
07-18-05, 02:20 AM   #4
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
this:RegisterEvent would have worked had it been in your frames OnLoad or OnShow block or the like.
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » un/registering events

Thread Tools
Display Modes

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