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

Module menus

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


Version: 18.04.28

Classes
  Item
Menu item Python Type, wrapping ObjC NSMenuItem.
  Menu
Menu Python Type, wrapping ObjC NSMenu.
  MenuBar
Menu bar Python Type, wrapping ObjC NSMenu.
  Separator
Menu separator Python 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.