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 WindowEvent(). 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, menuitem or systray 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 Repeat Event = WaitWindowEvent() Until Event = #PB_Event_CloseWindow
See Also
BindEvent(), BindGadgetEvent(), BindMenuEvent(), WindowEvent(), WaitWindowEvent()
Supported OS
All