UnbindGadgetEvent()

语法

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

参数

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

返回值

无.

示例

  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

参阅

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

已支持操作系统

所有

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