396 - Create("Frame") no OnShow?
I'm a little surprised that there is no callback for OnShow on the Create("Frame") method for the AceGUI. AceGUIContainer-Frame.lua
It has a OnClose/OnHide but no OnShow. Sometimes a developer wants something to fire or refresh when a frame is shown. Currently the Create("Frame") method does not allow for callbacks to OnShow. Unless of course I'm missing something somewhere ;)
Example:
local frame = AceGUI:Create("Frame")
frame:SetCallback("OnShow",function() Foobar() end)
Foobar() would never be called since OnShow is never fired.
Another widget with the same issue is the Create("Window") or Window widget. It also has no means to get a callback on OnShow without actually hooking it.
Please let me know if this is intentional or there is another method of doing this.
| User | When | Change |
|---|---|---|
| Nevcairiel | Aug 27, 2016 at 16:31 UTC | Changed status from New to Accepted |
| Nevcairiel | Aug 27, 2016 at 16:31 UTC | Changed assigned to from Kaelten to Nevcairiel |
| Xruptor | Aug 25, 2016 at 13:10 UTC | Changed description:Foobar() would never be called since OnShow is never fired. + Another widget with the same issue is the Create("Window") or Window widget. It also has no means to get a callback on OnShow without actually hooking it. + Please let me know if this is intentional or there is another method of doing this. |
| Xruptor | Aug 24, 2016 at 17:25 UTC | Changed component from None to AceGUI-3.0 |
| Xruptor | Aug 24, 2016 at 17:23 UTC | Changed description: Example:
local frame = AceGUI:Create("Frame")
- frame :SetCallback("OnShow",function() Foobar() end)
+ frame:SetCallback("OnShow",function() Foobar() end)
Foobar() would never be called since OnShow is never fired. |
| Xruptor | Aug 24, 2016 at 17:22 UTC | Create |
- 4 comments
- 4 comments
Facts
- Last updated
- Aug 27, 2016
- Reported
- Aug 24, 2016
- Status
- Accepted - Problem reproduced / Need acknowledged.
- Type
- Defect - A shortcoming, fault, or imperfection
- Priority
- Medium - Normal priority.
- Votes
- 0
- Component
- AceGUI-3.0
- Reply
- #4
Xruptor Aug 28, 2016 at 16:17 UTC - 0 likesThats great to hear! Thanks Nevcairiel, it will be nice to have the OnShow event fired for the Frame and Window widgets.
- Reply
- #3
Nevcairiel Aug 27, 2016 at 16:30 UTC - 0 likesGuess it just never came up, most people would probably recycle the frame when its hidden and then run a full init when its shown again. But no reason not to fire another event.
- Reply
- #2
Xruptor Aug 24, 2016 at 17:40 UTC - 0 likesBefore I forget, I know you can do the following for the same results. However, I would like to use the SetCallBacks which is part of the AceGUI framework instead.
hooksecurefunc(frame, "Show" , function() FooBar() end)
- Reply
- #1
Xruptor Aug 24, 2016 at 17:25 UTC - 0 likesForgot to set the Component