View Single Post
12-11-05, 02:44 AM   #4
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Yeah OnUpdates happen every frame. But OnUpdates don't happen at all while the frame is hidden. Note that the frame is hidden at start, and that OnDragStop hides the frame. It's only visible after OnDragStart. The button is moved and the OnUpdate runs for like 5 seconds for the lifetime of the mod.

If you want you can add throttling to the OnUpdate handler which is a very good idea in almost all situations. But since this OnUpdate hardly runs it's not necessary and a bit overkill.

A slider with named labels and stuff will take up more memory than a single frame with an OnUpdate. And it can be argued that the initialization of a slider is a lot more involved than the the infrequent movement of the button, when you can keep the position and then just move it on login to a SavedVariable.
  Reply With Quote