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

Module menus

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


Version: 18.08.09

Classes
  Item
Python menu Item Type, wrapping ObjC NSMenuItem.
  ItemSeparator
Python menu ItemSeparator Type, wrapping ObjC NSMenuItem.separatorItem.
  Menu
Python Menu Type, wrapping ObjC NSMenu.
  MenuBar
Python MenuBar Type, wrapping ObjC NSMenu.
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.