Package pycocoa :: Module menus
[frames] | no frames]

Module menus

Types Item, Menu, MenuBar and Separator, wrapping ObjC NSMenuItem and NSMenu.


Version: 18.06.10

Classes
  Item
Python menu Item Type, wrapping ObjC NSMenuItem.
  Menu
Menu Python Type, wrapping ObjC NSMenu.
  MenuBar
Python MenuBar Type, wrapping ObjC NSMenu.
  Separator
Python menu Separator Type, wrapping ObjC NSMenuItem.separatorItem.
Functions
 
ns2Item(ns)
Get the Item instance for an NSMenuItem.
 
title2action(title)
Convert a menu item title to a valid callback method name.
Function Details

ns2Item(ns)

 

Get the Item instance for an NSMenuItem.

Parameters:
  • ns - The ObjC instance (NSMenuItem).
Returns:
The item instance (Item).
Raises:
  • TypeError - Invalid ns type.

title2action(title)

 

Convert a menu item title to a valid callback method name.

Parameters:
  • title - The item's title (str).
Returns:
Name for the callback method (str).
Raises:
  • ValueError - Invalid method name for this title.