UnbindEvent()

Syntax

UnbindEvent(Event, @Callback() [, Window [, Object [, EventType]]])
Description
Unbind an event from a callback. If no matching event callback is found, this command has no effect.

Parameters

Event The event to unbind. For a full list of events, see BindEvent(). Custom events are also supported, when using PostEvent().
@Callback() The callback procedure to unbind.
Window (optional) The #Window number to unbind the event.
Object (optional) The object number to unbind the event. It can be a gadget or menuitem number.
EventType (optional) The event type to unbind the event from. For a full list of supported types, see EventType().

Return value

None.

Example

  Procedure SizeWindowHandler()
    Debug "Size event on window #" + EventWindow()
  EndProcedure
  
  OpenWindow(0, 100, 100, 200, 200, "Resize test", #PB_Window_SizeGadget | #PB_Window_SystemMenu)
  
  BindEvent(#PB_Event_SizeWindow, @SizeWindowHandler())
  UnbindEvent(#PB_Event_SizeWindow, @SizeWindowHandler()) ; Unbind it immediately

See Also

BindEvent(), BindGadgetEvent(), BindMenuEvent()
<- StickyWindow() - Window Index - WindowBounds() ->