def selectone(pEvent, pLabel=TopLabel, pFileNames=pFileNames):
        '''
        Build menu from menu file
        The menu file may contain commands to set the current directory and to
        set specified environment variables.  This is done while the file is
        being read.  They are not dependent on the selected button.  The last 
        command encountered will be active.
    
        set environment variable name to value
            ;#set`name=value
        set current directory to path
            ;#cd`path
        '''
        global mFileList, mMessage, TopLevel
        
        if TopLevel == None:
            TopLevel = Tkinter.Toplevel(width=60)
            lCurrentPath = pLabel.cget("text").strip()
            
            lFrame = Tkinter.Frame(TopLevel)
            lFrame.pack(side=TOP, fill=BOTH, expand=1)
            
            lScrollBar = Tkinter.Scrollbar(lFrame, orient=VERTICAL )
            lScrollBar.pack(side=RIGHT, fill=Y)
    
            mFileList = Tkinter.Listbox(lFrame, yscrollcommand=lScrollBar.set)
            mFileList.pack(side=LEFT, fill=BOTH, expand=1)
            mFileList.bind("<Double-Button-1>", OKed)
    
            lScrollBar.config(command=mFileList.yview)
            
            lFrame = Tkinter.Frame(TopLevel)
            lFrame.pack(side=TOP, fill=X)
            lCancel = Tkinter.Button(lFrame, text='Cancel', bg="#FF0000")
            lCancel.pack(side=LEFT)
            lCancel.bind("<Button-1>", canceled) 
            
            lOK = Tkinter.Button(lFrame, text='Apply', bg="#00FF00")
            lOK.pack(side=RIGHT)
            lOK.bind("<Button-1>", OKed) 
            
            mMessage = Tkinter.Label(lFrame, text='-----')
            mMessage.pack(side=LEFT, fill=X, expand=1)
            lPos = 0
            lCurrent = -1
            for lFilePath in pFileNames:
                mFileList.insert(END, lFilePath)
                if lCurrentPath == lFilePath:
                    mFileList.selection_set(END)
                    mMessage.config(text=lCurrentPath)
                    lCurrent = lPos
                    mFileList.see(lCurrent)
                lPos += 1

        Build menu from menu file
        The menu file may contain commands to set the current directory and to
        set specified environment variables.  This is done while the file is
        being read.  They are not dependent on the selected button.  The last 
        command encountered will be active.
    
        set environment variable name to value
            ;#set`name=value
        set current directory to path
            ;#cd`path
        
recipes/Python/577039_Moderately_Simple_Buttonbar/recipe-577039.py