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.
              default = RIGHT. This only has effect in the top level menu
        """

        # id's for widgets in the menu
        self._button_no = -1
        # list of dictionaries for widgets (in order displayed)
        self._wdicts = []
        # set when this menu is posted
        self.is_posted = 0
        # if this is a sub-menu, and it's posted,
        # here's the ExtraMenu object of which it's a sub-menu (if any)
        self._parent = None
        # if there's a sub-menu posted from this menu, here's the
        # ExtraMenu object for the sub-menu
        self._child = None
        # the main menu button's window
        self._master = master
        # the root display (needed for placing menus)
        self._root = root

        # for sub-menus, determine which side to display it on
        self._cascade_side = kw.pop( 'cascade_side', RIGHT )
        # determines if this
        self._is_submenu = kw.pop( 'is_submenu', False )

        if not self._cascade_side :
            self._cascade_side = RIGHT

        # any left over keywords are for the menu frame
        self._menu_frame_kw = kw

        # a one pixel empty bitmap for use in separators
        self._empty = BitmapImage( data = EMPTY )
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.
              default = RIGHT. This only has effect in the top level menu
        
recipes/Python/442500_ExtraMenu__TkInter_menu_arbitrary_widgets/recipe-442500.py