UnbindMenuEvent()

语法

UnbindMenuEvent(#Menu, MenuItem, @Callback())
概要
Unbind a menu event from a callback. If no matching event callback is found, this command has no effect.

参数

#Menu The menu to unbind the event.
MenuItem The menu item within the menu to unbind the event.
@Callback() The callback procedure to unbind.

返回值

无.

示例

  Procedure TestHandler()
    Debug "Test menu event"
  EndProcedure
  
  Procedure QuitHandler()
    Debug "Quit menu event"
    End
  EndProcedure
  
  OpenWindow(0, 100, 100, 200, 50, "Click test", #PB_Window_SystemMenu)
  
  CreateMenu(0, WindowID(0))
    MenuTitle("File")
      MenuItem(0, "Test")
      MenuItem(1, "Quit")
  
  BindMenuEvent(0, 0, @TestHandler())
  BindMenuEvent(0, 1, @QuitHandler())
  
  UnbindMenuEvent(0, 1, @QuitHandler()) ; Unbind the quit event
  
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow

参阅

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

已支持操作系统

所有

<- SetMenuTitleText() - Menu Index