Thread Tools Display Modes
01-09-18, 11:01 PM   #1
Eungavi
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
hiding widgets without unregistering events

Hiya!

Just a quick question here. Does hidden widgets without unregistering events would still respond to a registered events and its handler?

Thank you
  Reply With Quote
01-10-18, 12:57 AM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
They should still respond, yes. Hiding is exactly that –– not making it visible, whereas unregistering an event is exactly how it sounds. Hiding and unregistration are two separate things altogether.

Case in point, think about how an event handler frame is created:
  1. Create the frame
  2. Register event(s) on the frame
  3. Set a script handler on the frame
  4. Hide the frame
Widgets operate the same way.
  Reply With Quote
01-10-18, 05:12 AM   #3
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Events will still be listened to, but OnUpdate handlers will not fire since those are ran every time a new frame is rendered - hidden frames are obviously not rendered.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
01-10-18, 04:29 PM   #4
Eungavi
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
Thank you guys
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » hiding widgets without unregistering 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