4/8/2023 0 Comments Xmenu similar![]() ![]() _wdicts = # set when this menu is posted self. _button_no = - 1 # list of dictionaries for widgets (in order displayed) self. This only has effect in the top level menu """ # id's for widgets in the menu self. An important difference between an ExtraMenu and other Menus is that the wigets compromising the menu are created only when the menu is post()ed and destroyed when the menu is unpost()ed """ def _init_ ( self, master, root, ** kw ) : """Construct an ExtraMenu widget with parent window 'master' to be displayed in the top-level window 'root' Arguments: master : the Frame in which the menu's main button is to be placed (for the top level menu), ignored for sub-menus root : the toplevel window which contains 'master' args : no other positional arguments kw : these values will be passed to construct a Frame object for the menu, except for the following, which are for the ExtraMenu object: is_submenu : True makes this is a sub-menu default = False cascade_side : LEFT/RIGHT - which side sub-menus will appear on. You could even put a canvas up as a sub-menu. However, complex widgets, such as Pmw.ComboBoxes are a single widget in this context. ![]() If the sub-menu is a widget other than a Button, Label, separator, Checkbutton or Radiobutton, then there can be no other widgets in the sub-menu. Sub-menus can be set to appear whenever the menu button is active, or only when the button is selected. A button can be used to create a sub-menu which will appear to the side of the main menu next to its invoking button. The topmost level is a Button which, when activated, drops down a menu containing any of Buttons, separators, Labels, Checkbuttons or RadioButtons. Sub-menus can be instances of an ExtraMenu or any other widget. # $Id: xmenu.py,v 1.20 1 18:03:22 jes Exp jes $ # Copyright 2005 Jim Segrave from Tkinter import * import re EMPTY = """ #define empty_width 1 #define empty_height 1 static unsigned char empty_bits = """ class ExtraMenu : """Class for creating a menu with optional sub-menus. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |