Is there a Spring command that will load/initialize a widget?
I am looking for the something like the widgetHandler:RemoveWidget(), but with the flexibility to add and initialize any widget (by name or id), once a gadget detects a specific event.
Thanks
Loading a Widget from a different Widget or Gadget
Moderator: Moderators
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Loading a Widget from a different Widget or Gadget
Spring doesn't know about widget/gadgets. They are purely implemented inside the Lua environment.super_g wrote:Is there a Spring command that will load/initialize a widget?
You might need to override the widget/gadget handler. Take a look at ZK, it implements it's own F11 list.I am looking for the something like the widgetHandler:RemoveWidget(), but with the flexibility to add and initialize any widget (by name or id), once a gadget detects a specific event.
Re: Loading a Widget from a different Widget or Gadget
I found an easy was to enable or disable widgets using the following Spring Commands:
Spring.SendCommands({"luaui enablewidget <widgetName>"})
Spring.SendCommands({"luaui disablewidget <widgetName>"})
Spring.SendCommands({"luaui enablewidget <widgetName>"})
Spring.SendCommands({"luaui disablewidget <widgetName>"})
Re: Loading a Widget from a different Widget or Gadget
Yes. Spring still does not know about the widgets though. These commands are sent to the lua environment and the magic happens there.
Re: Loading a Widget from a different Widget or Gadget
Most often, users want a pragmatic answer. Your stringent technicalities may be exact from a rigorous point of view, but are irrelevant here.