gui.connect

Binds a GUI component to a listening function and event.

Prototype

  1. bOk = gui.connect ( hSender, sEvent, hReceiver|nil, sHandler )

Description

Does the same thing as XML <connect sender="Component ID " event="kEvent" handler="LUA functions" /> but allows you to bind a dynamic component or dynamic function depending to the situation.


Parameters

hSender - sender component handle
kEvent - predefined event constant
hReceiver|nil - receiver component handle
sHandler - handler function string


Return values

bOk - true on successful binding


Sample

  1. gui.disconnect ( hItem, gui.kEventMenuActionTriggered, nil, nil )
  2. gui.connect ( hItem, gui.kEventMenuActionTriggered, nil, sTriggerMenuActionOpenWithCallback or "commonAPITriggerMenuActionOpenWith" )

Available since ShiVa 2.0