Staging: this is not the live site, pydocs.org.
Graphical user interfaces with Tk
A Menu widget displays a column of entries, each of which may be a command, a checkbutton, a radiobutton, a cascade (which posts an associated submenu) or a separator. Menus are used as the menubar of a toplevel window, as pulldown menus posted from a cascade entry or menubutton, and as popup menus. Inherits from Widget. Members of Menu a activate Make the entry given by index the active entry, redisplaying it with its active colors, and deactivate any previously active entry. add Add a new entry to the bottom of the menu. add_cascade Add a new cascade entry to the bottom of the menu. add_command Add a new command entry to the bottom of the menu. d delete Delete all of the menu entries between index1 and index2 inclusive. e entrycget Return the current value of the configuration option option for the entry given by index. entryconfig Query or modify the configuration options of the entry given by index. entryconfigure Query or modify the configuration options of the entry given by index. i index Return the numerical index corresponding to index, or None if index selects no entry. insert Same as add(), except that the new entry is inserted just before the entry given by index instead of being appended to the end of the menu. insert_cascade Insert a new cascade entry before the entry given by index (see add_cascade()). insert_checkbutton Insert a new checkbutton entry before the entry given by index (see add_checkbutton()). insert_command Insert a new command entry before the entry given by index (see add_command()). insert_radiobutton Insert a new radiobutton entry before the entry given by index (see add_radiobutton()). insert_separator Insert a separator before the entry given by index (see add_separator()). invoke Invoke the action of the entry given by index, as if it had been clicked. p post Display the menu on the screen at the root-window coordinates x and y, adjusting them if necessary so that the whole menu is visible. t tk_popup Post the menu as a popup at the root-window coordinates x and y. type Return the type of the entry given by index: one of 'command', 'cascade', 'checkbutton', 'radiobutton', 'separator' or 'tearoff' (for the tear-off entry). u unpost Unmap the menu so that it is no longer displayed, also unposting any posted lower-level cascaded submenu. x xposition Return the x-coordinate, within the menu window, of the leftmost pixel of the entry given by index. y yposition Return the y-coordinate, within the menu window, of the topmost pixel of the entry given by index.
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF