Loading a Widget from a different Widget or Gadget

Loading a Widget from a different Widget or Gadget

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderators: Moderators, Moderators

Post Reply
super_g
Posts: 13
Joined: 12 Jan 2012, 04:10

Loading a Widget from a different Widget or Gadget

Post by super_g »

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
0 x

SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Loading a Widget from a different Widget or Gadget

Post by SirMaverick »

super_g wrote:Is there a Spring command that will load/initialize a widget?
Spring doesn't know about widget/gadgets. They are purely implemented inside the Lua environment.
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.
You might need to override the widget/gadget handler. Take a look at ZK, it implements it's own F11 list.
0 x

super_g
Posts: 13
Joined: 12 Jan 2012, 04:10

Re: Loading a Widget from a different Widget or Gadget

Post by super_g »

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>"})
0 x

zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Loading a Widget from a different Widget or Gadget

Post by zerver »

Yes. Spring still does not know about the widgets though. These commands are sent to the lua environment and the magic happens there.
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7022
Joined: 16 Nov 2004, 13:08

Re: Loading a Widget from a different Widget or Gadget

Post by zwzsg »

Most often, users want a pragmatic answer. Your stringent technicalities may be exact from a rigorous point of view, but are irrelevant here.
0 x

Post Reply

Return to “Engine”