UnbindGadgetEvent()

Syntax

UnbindGadgetEvent(#Gadget, @Callback() [, EventType])
Description
Unbind a gadget event from a callback. If no matching event callback is found, this command has no effect.

Parameters

#Gadget The gadget to unbind the event.
@Callback() The callback procedure to unbind.
EventType (optional) The event type to unbind the event from. For a full list of supported types, see EventType().

Return value

None.

Example

  Procedure ButtonHandler()
    Debug "Button click event on gadget #" + EventGadget()
  EndProcedure
  
  OpenWindow(0, 100, 100, 200, 50, "Click test", #PB_Window_SystemMenu)
  
  ButtonGadget(0, 10, 10, 180, 30, "Click me")
  
  BindGadgetEvent(0, @ButtonHandler())
  UnbindGadgetEvent(0, @ButtonHandler()) ; Unbind it immediately
  
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow

See Also

BindEvent(), BindGadgetEvent(), BindMenuEvent(), WindowEvent(), WaitWindowEvent()

Supported OS

All

<- TreeGadget() - Gadget Index - UseGadgetList() ->