UnbindMenuEvent()

Syntax

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

Parameters

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

Return value

None.

Example

  Procedure TestHandler()
    Debug "Test menu event"
  EndProcedure
  
  Procedure QuitHandler()
    Debug "Quit menu event"
  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

See Also

BindEvent(), BindGadgetEvent(), BindMenuEvent()

Supported OS

All

<- SetMenuTitleText() - Menu Index