UnbindEvent()

语法

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

参数

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().

返回值

无.

示例

  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

参阅

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

已支持操作系统

所有

<- StickyWindow() - Window Index - WaitWindowEvent() ->