Example #1
0
    def startUI(self):

        self.files = os.listdir(os.getcwd())

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Exit", command=self.quit)

        menubar.add_cascade(label="File", menu=fileMenu)

        listbox = Listbox(self.parent, selectmode=SINGLE)
        listbox.pack(fill=BOTH, expand=1)
        # listbox.insert(END, 'bebs')
        for i in self.files:
            listbox.insert(END, i)

        listbox.grid(column=0, columnspan=4, row=0, rowspan=10, sticky=N+S+E+W)


        txt = Text(self.parent)
        txt.grid(column=6, columnspan=8, row=0, rowspan=10, sticky=N+S+E+W)
        # txt.pack(fill=BOTH, expand=1)

        oBtn = Button(text="Open->", command=lambda: self.readContents(listbox, txt))

        oBtn.grid(column=5, row=3)
    def __init__(self, namespace):
        Tk.__init__(self, className="Koshka")

        self.dac = DAC()
        self.dac.start()

        self.score_path = namespace.score

        self.sequencer = None
        self.sequencer_frame = None
        self.mixer_window = None
        self.scale_window = None
        self._open_score(self.score_path)

        menu = Menu(self)
        self.config(menu=menu)
        filemenu = Menu(menu)
        menu.add_cascade(label="File", menu=filemenu)
        filemenu.add_command(label="Open...", command=self.open, accelerator="meta-o")
        filemenu.add_command(label="Save", command=self.save, accelerator="meta-s")
        filemenu.add_command(label="Save As...", command=self.save_as, accelerator="meta-shift-s")
        filemenu.add_separator()
        filemenu.add_command(label="Exit", command=self.quit)

        menu.add_cascade(label="Help", menu=filemenu)
        filemenu.add_command(label="Online Help...", command=lambda: webbrowser.open_new_tab(URL_HELP_DOC))

        # Note: This is only implemented and tested for Mac OS
        self.bind_all("<Command-o>", self.open)
        self.bind_all("<Command-s>", self.save)
        self.bind_all("<Command-Shift-s>", self.save_as)
        self.bind_all("<Meta-o>", self.open)
        self.bind_all("<Meta-s>", self.save)
        self.bind_all("<Meta-Shift-s>", self.save_as)
Example #3
0
def overrideRootMenu(root, flist):
    from Tkinter import Menu, Text, Text
    from idlelib.EditorWindow import prepstr, get_accelerator
    from idlelib import Bindings
    from idlelib import WindowList
    from idlelib.MultiCall import MultiCallCreator
    closeItem = Bindings.menudefs[0][1][-2]
    del Bindings.menudefs[0][1][-3:]
    Bindings.menudefs[0][1].insert(6, closeItem)
    del Bindings.menudefs[-1][1][0:2]
    del Bindings.menudefs[-2][1][0:2]
    menubar = Menu(root)
    root.configure(menu=menubar)
    menudict = {}
    menudict['windows'] = menu = Menu(menubar, name='windows')
    menubar.add_cascade(label='Window', menu=menu, underline=0)

    def postwindowsmenu(menu=menu):
        end = menu.index('end')
        if end is None:
            end = -1
        if end > 0:
            menu.delete(0, end)
        WindowList.add_windows_to_menu(menu)
        return

    WindowList.register_callback(postwindowsmenu)

    def about_dialog(event=None):
        from idlelib import aboutDialog
        aboutDialog.AboutDialog(root, 'About IDLE')

    def config_dialog(event=None):
        from idlelib import configDialog
        root.instance_dict = flist.inversedict
        configDialog.ConfigDialog(root, 'Settings')

    def help_dialog(event=None):
        from idlelib import textView
        fn = path.join(path.abspath(path.dirname(__file__)), 'help.txt')
        textView.view_file(root, 'Help', fn)

    root.bind('<<about-idle>>', about_dialog)
    root.bind('<<open-config-dialog>>', config_dialog)
    root.createcommand('::tk::mac::ShowPreferences', config_dialog)
    if flist:
        root.bind('<<close-all-windows>>', flist.close_all_callback)
        root.createcommand('exit', flist.close_all_callback)
    if isCarbonTk():
        menudict['application'] = menu = Menu(menubar, name='apple')
        menubar.add_cascade(label='IDLE', menu=menu)
        Bindings.menudefs.insert(0, ('application', [('About IDLE', '<<about-idle>>'), None]))
        tkversion = root.tk.eval('info patchlevel')
        if tuple(map(int, tkversion.split('.'))) < (8, 4, 14):
            Bindings.menudefs[0][1].append(('_Preferences....', '<<open-config-dialog>>'))
    if isCocoaTk():
        root.createcommand('tkAboutDialog', about_dialog)
        root.createcommand('::tk::mac::ShowHelp', help_dialog)
        del Bindings.menudefs[-1][1][0]
    return
 def __init__(self):
     root = Tk()
     root.title("Fractal Dimension")
     root.geometry("1000x500+500+500")
     menu = Menu(root)
     root.config(menu=menu)
     filemenu = Menu(menu)
     view_menu = Menu(menu)
     menu.add_cascade(label="File", menu=filemenu)
     menu.add_cascade(label="View", menu=view_menu)
     filemenu.add_command(label="Load data",command = self.load_data)
     view_menu.add_command(label="Canvas 128",command = lambda:self.view_ca(0))
     view_menu.add_command(label="Canvas 64",command = lambda:self.view_ca(1))
     view_menu.add_command(label="Canvas 32",command = lambda:self.view_ca(2))
     view_menu.add_command(label="Canvas 16",command = lambda:self.view_ca(3))
     view_menu.add_command(label="Canvas 8",command = lambda:self.view_ca(4))
     view_menu.add_command(label="Canvas 4",command = lambda:self.view_ca(5))
     view_menu.add_command(label="Canvas 2",command = lambda:self.view_ca(6))
     view_menu.add_command(label="Canvas 1",command = lambda:self.view_ca(7))
         
     self.ca=[]
     max_size = 128
     while max_size>0:
         self.ca.append(CaCanvas(root,500,500,max_size,max_size))
         max_size = max_size/2
         
     self.current_view = 0
     
     self.ca[self.current_view].grid(row=0,column=0)
     self.tkplot = TkinterGraph(root)
     self.tkplot.grid(row=0,column=1)
     root.mainloop()
Example #5
0
    def initUI(self):

        self.parent.title("MyStock")
        self.style = Style()
        self.style.theme_use("default")

        frame = Frame(self, relief=RAISED, borderwidth=1)
        frame.pack(fill=BOTH, expand=True)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="File", menu=fileMenu)

        submenu= Menu(fileMenu)
        submenu.add_command(label="New feed")
        submenu.add_command(label="Bookmarks")
        submenu.add_command(label="Mail")
        fileMenu.add_cascade(label='Import', menu=submenu, underline=0)

        fileMenu.add_separator()

        closeButton = Button(self, text="Close", command=self.quit)
        closeButton.pack(side=RIGHT, padx=5, pady=5)
        okButton = Button(self, text="OK")
        okButton.pack(side=RIGHT)

        self.pack(fill=BOTH, expand=1)
        self.centerWindow()
Example #6
0
    def initUI(self):

        self.parent.title("Toolbar")

        menubar = Menu(self.parent)
        self.fileMenu = Menu(self.parent, tearoff=0)
        self.fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="File", menu=self.fileMenu)

        toolbar = Frame(self.parent, bd=1, relief=RAISED)

        self.img = Image.open(IMG_DIR + "exit.png")
        cropped = self.img.resize((25, 25), Image.ANTIALIAS)
        eimg = ImageTk.PhotoImage(cropped)

        exitButton = Button(toolbar,
                            image=eimg,
                            relief=FLAT,
                            command=self.quit)
        exitButton.image = eimg
        exitButton.pack(side=LEFT, padx=2, pady=2)

        toolbar.pack(side=TOP, fill=X)
        self.parent.config(menu=menubar)
        self.pack()
Example #7
0
    def _init_menubar(self, parent):
        menubar = Menu(parent)

        filemenu = Menu(menubar, tearoff=0)
        filemenu.add_command(label="Exit", underline=1, command=self.destroy, accelerator="q")
        menubar.add_cascade(label="File", underline=0, menu=filemenu)

        actionmenu = Menu(menubar, tearoff=0)
        actionmenu.add_command(label="Next", underline=0, command=self.next, accelerator="n, Space")
        actionmenu.add_command(label="Previous", underline=0, command=self.prev, accelerator="p, Backspace")
        menubar.add_cascade(label="Action", underline=0, menu=actionmenu)

        optionmenu = Menu(menubar, tearoff=0)
        optionmenu.add_checkbutton(
            label="Remove Duplicates",
            underline=0,
            variable=self._glue.remove_duplicates,
            command=self._toggle_remove_duplicates,
            accelerator="r",
        )
        menubar.add_cascade(label="Options", underline=0, menu=optionmenu)

        viewmenu = Menu(menubar, tearoff=0)
        viewmenu.add_radiobutton(label="Tiny", variable=self._size, underline=0, value=10, command=self.resize)
        viewmenu.add_radiobutton(label="Small", variable=self._size, underline=0, value=12, command=self.resize)
        viewmenu.add_radiobutton(label="Medium", variable=self._size, underline=0, value=14, command=self.resize)
        viewmenu.add_radiobutton(label="Large", variable=self._size, underline=0, value=18, command=self.resize)
        viewmenu.add_radiobutton(label="Huge", variable=self._size, underline=0, value=24, command=self.resize)
        menubar.add_cascade(label="View", underline=0, menu=viewmenu)

        helpmenu = Menu(menubar, tearoff=0)
        helpmenu.add_command(label="About", underline=0, command=self.about)
        menubar.add_cascade(label="Help", underline=0, menu=helpmenu)

        parent.config(menu=menubar)
Example #8
0
 def setupWidgets(self):
     menubar = Menu(self.root)
     filemenu = Menu(menubar, tearoff=0)
     filemenu.add_command(label="New", command=lambda: self.donothing())
     filemenu.add_command(label="Open", command=lambda: self.chooseFile())
     filemenu.add_command(label="Save", command=lambda: self.donothing())
     filemenu.add_command(label="Save as...", command=lambda: self.donothing())
     filemenu.add_command(label="Close", command=lambda: self.donothing())
     
     filemenu.add_separator()
     
     filemenu.add_command(label="Exit", command=lambda: self.quitCallBack())
     menubar.add_cascade(label="File", menu=filemenu)
     editmenu = Menu(menubar, tearoff=0)
     editmenu.add_command(label="Undo", command=lambda: self.donothing())
     
     helpmenu = Menu(menubar, tearoff=0)
     helpmenu.add_command(label="Help Index", command=lambda: self.donothing())
     helpmenu.add_command(label="About...", command=lambda: self.donothing())
     menubar.add_cascade(label="Help", menu=helpmenu)
     
     self.root.config(menu=menubar)
     
     # label for the video frame
     self.videoLabel = tk.Label(master=self.root)
     self.videoLabel.bind("<Button-1>", lambda e: self.handleVideoClick())
     self.videoLabel.pack()
    def __init__(self, parent, *args, **kwargs):
        tk.Frame.__init__(self, parent, *args, **kwargs)
        self.parent = parent
        #<create the rest of your GUI here>
        parent.title("PhoneBook")
        parent.geometry("400x400+100+140")
        """
        self.toolbar = Toolbar(self)
        self.toolbar.pack(side="top", fill="x")
        """
        #Adaugarea meniu barului
        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)
        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Exit", command=self.quit)
        menubar.add_cascade(label="File", menu=fileMenu)

        helpAbout = Menu(menubar)
        helpAbout.add_command(label="About")
        menubar.add_cascade(label="Help", menu=helpAbout)
        """
        #adaugarea toolbarului
        self.toolBar = tk.Toplevel(self.parent, bd=1, relief=RAISED)
        self.btnExit = Button(self.toolBar, relief=FLAT, command=self.quit)
        self.btnExit.pack(side=LEFT, padx=2, pady=2)
        self.toolBar(side=TOP, fill=X)
        """
        Label(self.parent, text="Nume/Prenume: ").pack()
        entNumePrenume = Entry(self.parent).pack() 
        
        self.pack()
    def _init_menu(self):
        """Init menu bar content.
        """
        toplevel = self.winfo_toplevel()
        if toplevel['menu']:
            self._menu = self.nametowidget(name=toplevel['menu'])
        else:
            self._menu = Menu(toplevel)
            toplevel['menu'] = self._menu

        graph_options = Menu(self._menu, tearoff=0)
        self._menu.add_cascade(label="Graph", menu=graph_options)
        self._menu_index = self._menu.index("end")

        vertex_label_position_menu = Menu(graph_options, tearoff=0)
        graph_options.add_cascade(label="Label position",
                                  menu=vertex_label_position_menu)

        menu_var = self.winfo_name() + ".vertexlabelposition"
        vertex_label_position_menu.add_radiobutton(variable=menu_var,
                                                   label="Auto",
                                                   value="auto")
        vertex_label_position_menu.add_radiobutton(variable=menu_var,
                                                   label="Center",
                                                   value="center")

        graph_options.add_command(label="Save graph...",
                                  command=self.call_graph_save_dialog)

        self.bind("<Destroy>", self.__destroy_menu)
Example #11
0
class GUI_MoveRelativeTool:
    def __init__(self, master, distance):
        self.master = master
        self.master.title('Tools')
        self.createWidgets()
        self.set(distance)

    def callback(self, cb):
        self._callback = cb

    def do_callback(self, context, *args):
        if hasattr(self, '_callback'):
            self._callback(context, *args)

    def createWidgets(self):

        self.mainmenu = Menu(self.master)
        self.mainmenu.config(borderwidth=1)
        self.master.config(menu=self.mainmenu)

        self.filemenu = Menu(self.mainmenu)
        self.filemenu.config(tearoff=0)
        self.mainmenu.add_cascade(label='File',
                                  menu=self.filemenu,
                                  underline=0)
        self.filemenu.add_command(label='Apply', command=self.wApplyCB)
        self.filemenu.add_command(label='Cancel', command=self.wCancelCB)

        self.master.grid_rowconfigure(0, weight=1)
        self.master.grid_columnconfigure(0, weight=1)

        w = wFrame = LabelFrame(self.master, text='Move relative')

        w.grid(row=0, column=0, sticky=NSEW, padx=5, pady=5)
        w.grid_columnconfigure(0, weight=0)
        w.grid_columnconfigure(1, weight=1)

        w = Label(wFrame, text='Distance (mm) :', anchor=E)
        w.grid(row=0, column=0, sticky=NSEW)

        w = self.wDistance = XFloatEntry(wFrame,
                                         bg='white',
                                         width=10,
                                         borderwidth=2,
                                         justify=LEFT)
        w.grid(row=0, column=1, sticky=NSEW)
        w.callback(self.wEnterCB)
        w.enable_color(enable=False)

    def wApplyCB(self):
        self.do_callback(APPLY, self.wDistance.get() * mm_to_m)

    def wEnterCB(self, *args):
        self.do_callback(ENTER, self.wDistance.get() * mm_to_m)

    def wCancelCB(self):
        self.do_callback(CANCEL)

    def set(self, distance):
        self.wDistance.set(round(distance * m_to_mm, 1))
Example #12
0
    def _init_menubar(self):
        menubar = Menu(self._top)

        filemenu = Menu(menubar, tearoff=0)
        filemenu.add_command(label='Print to Postscript', underline=0,
                             command=self._cframe.print_to_file,
                             accelerator='Ctrl-p')
        filemenu.add_command(label='Exit', underline=1,
                             command=self.destroy, accelerator='Ctrl-x')
        menubar.add_cascade(label='File', underline=0, menu=filemenu)

        zoommenu = Menu(menubar, tearoff=0)
        zoommenu.add_radiobutton(label='Tiny', variable=self._size,
                                 underline=0, value=10, command=self.resize)
        zoommenu.add_radiobutton(label='Small', variable=self._size,
                                 underline=0, value=12, command=self.resize)
        zoommenu.add_radiobutton(label='Medium', variable=self._size,
                                 underline=0, value=14, command=self.resize)
        zoommenu.add_radiobutton(label='Large', variable=self._size,
                                 underline=0, value=28, command=self.resize)
        zoommenu.add_radiobutton(label='Huge', variable=self._size,
                                 underline=0, value=50, command=self.resize)
        menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu)

        self._top.config(menu=menubar)
Example #13
0
File: tree.py Project: sp00/nltk
    def _init_menubar(self):
        menubar = Menu(self._top)

        filemenu = Menu(menubar, tearoff=0)
        filemenu.add_command(label='Print to Postscript', underline=0,
                             command=self._cframe.print_to_file,
                             accelerator='Ctrl-p')
        filemenu.add_command(label='Exit', underline=1,
                             command=self.destroy, accelerator='Ctrl-x')
        menubar.add_cascade(label='File', underline=0, menu=filemenu)

        zoommenu = Menu(menubar, tearoff=0)
        zoommenu.add_radiobutton(label='Tiny', variable=self._size,
                                 underline=0, value=10, command=self.resize)
        zoommenu.add_radiobutton(label='Small', variable=self._size,
                                 underline=0, value=12, command=self.resize)
        zoommenu.add_radiobutton(label='Medium', variable=self._size,
                                 underline=0, value=14, command=self.resize)
        zoommenu.add_radiobutton(label='Large', variable=self._size,
                                 underline=0, value=28, command=self.resize)
        zoommenu.add_radiobutton(label='Huge', variable=self._size,
                                 underline=0, value=50, command=self.resize)
        menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu)

        self._top.config(menu=menubar)
Example #14
0
    def createMenubar( self ):
        "Create our menu bar."

        font = self.font

        mbar = Menu( self.top, font=font )
        self.top.configure( menu=mbar )

        # Application menu
        appMenu = Menu( mbar, tearoff=False )
        mbar.add_cascade( label=self.appName, font=font, menu=appMenu )
        appMenu.add_command( label='About Mini-CCNx', command=self.about,
                             font=font)
        appMenu.add_separator()
        appMenu.add_command( label='Quit', command=self.quit, font=font )

        #fileMenu = Menu( mbar, tearoff=False )
        #mbar.add_cascade( label="File", font=font, menu=fileMenu )
        #fileMenu.add_command( label="Load...", font=font )
        #fileMenu.add_separator()
        #fileMenu.add_command( label="Save", font=font )
        #fileMenu.add_separator()
        #fileMenu.add_command( label="Print", font=font )

        editMenu = Menu( mbar, tearoff=False )
        mbar.add_cascade( label="Edit", font=font, menu=editMenu )
        editMenu.add_command( label="Cut", font=font,
                              command=lambda: self.deleteSelection( None ) )
Example #15
0
    def initUI(self):

        self.parent.title("File dialog")

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Open", command=self.onOpen)
        menubar.add_cascade(label="File", menu=fileMenu)        
        self.style = Style()
        self.style.theme_use("default")        

        global frame1
        frame1 = Frame()
        frame1.grid(row=0, column=0, sticky='w')

        l1 = Label(frame1, text='CSV file name', relief=RIDGE, width=20)
        l1.grid(row=4, column=0)
        
        l2 = Label(frame1, text='SCR file name', relief=RIDGE, width=20)
        l2.grid(row=5, column=0)
        
        inform = Button(frame1, text="Choose CSV file", command=self.onCSVfile)
        inform.grid(row=1, column=0)

        self.file_opt = options = {}
        options['defaultextension'] = '.csv'
        options['filetypes'] = [('CSV files', '.csv'), ('all files', '.*')]
Example #16
0
    def __init__(self):
        Tk.__init__(self)
        self.title('socket tools in *nix')

        #Frame setting
        top_mbar = self.winfo_toplevel()

        frame_left = Frame(self)
        frame_right_top = Frame(self)
        frame_right_center = Frame(self)
        frame_right_bottom = Frame(self, height=40)

        #menu
        mbFile = Menu(top_mbar)
        top_mbar['menu'] = mbFile
        mbFile.subMenu = Menu(mbFile)
        mbFile.add_cascade(label='File', menu=mbFile.subMenu)
        mbFile.subMenu.add_command(label='Open', command=self.open_file)
        mbFile.subMenu.add_command(label='Exit', command=top_mbar.quit)
        mbFile.subMenu.entryconfig(0, state=Tkinter.DISABLED)

        #Button and Text
        self.text_send = Text(frame_right_center)
        self.text_send.grid()
        self.text_recv = Text(frame_right_top)
        self.text_recv.grid()

        #set ip and port
        ipf = Frame(frame_left, padx=10, pady=15)
        Label(ipf, text='ip', relief=Tkinter.RAISED, borderwidth=2, width=8).pack(side='left')
        self.ip = Entry(ipf)
        self.ip.pack(side='left')
        ipf.pack()

        portf = Frame(frame_left, padx=10, pady=5)
        Label(portf, text='port', relief=Tkinter.RAISED, borderwidth=2, width=8).pack(side='left')
        self.port = Entry(portf)
        self.port.pack(side='left')
        portf.pack()
        #set short and long link
        linkf = Frame(frame_left, padx=10, pady=15, relief=Tkinter.SUNKEN, borderwidth=2)
        self.flag = IntVar()
        Radiobutton(linkf, text="短链接", 
                value=0, variable=self.flag, 
                relief=Tkinter.RAISED)\
                        .pack(side=Tkinter.LEFT)
        Radiobutton(linkf, text="长链接", 
                value=1, variable=self.flag, 
                relief=Tkinter.RAISED)\
                        .pack(side=Tkinter.LEFT)
        linkf.pack()

        button_senddata = Button(frame_right_bottom, text='send', command=self.send).grid(sticky=Tkinter.W)

        #Grid
        frame_left.pack(side='left', anchor=Tkinter.N)
        frame_right_top.pack(side='top')
        frame_right_center.pack(side='top')
        frame_right_bottom.pack(side='top', anchor=Tkinter.E)
Example #17
0
    def initUI(self):
        self.parent.title("Inventario")
        
        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Cerrar", command=self.Close)
        menubar.add_cascade(label="File", menu=fileMenu)
 def __init__(self, parent, *args, **kwargs):
     tk.Frame.__init__(self, parent, *args, **kwargs)
     self.parent = parent
     #<create the rest of your GUI here>
     menubar = Menu(self.parent)
     self.parent.config(menu=menubar)
     fileMenu = Menu(menubar)
     fileMenu.add_command(label="Exit", command=self.quit)
     menubar.add_cascade(label="File", menu=fileMenu)
Example #19
0
 def set_up_menu(self):
     ''' Sets up the menu bar and its submenus '''
     menubar = Menu(self.root)
     filemenu = Menu(menubar, tearoff=0)
     filemenu.add_command(label="About", command=self.about)
     filemenu.add_separator()
     filemenu.add_command(label="Exit", command=self.root.quit)
     menubar.add_cascade(label="File", menu=filemenu)
     self.root.config(menu=menubar)
Example #20
0
	def initUI(self):
		self.parent.title("Gas Model")
		self.fonts = {'fontname'   : 'Helvetica',
		    'color'      : 'r',
		    'fontweight' : 'bold',
		    'fontsize'   : 14}
		self.npts = 32;
		self.sounds = 377.9683;
		self.skip = 1000.
		self.dt = 5000.*self.skip/(self.npts * self.sounds)

		menubar = Menu(self.parent)
		menubar.config(font=("Helvetica", 14, "italic"))
		self.parent.config(menu=menubar)

		fileMenu = Menu(menubar, tearoff=0)
		fileMenu.config(font=("Helvetica", 14, "italic"))
		fileMenu.add_command(label="Load", command=self.onLoad)
		fileMenu.add_command(label="Close", command=self.onClose)
		fileMenu.add_command(label="Exit", command=self.quit)
		menubar.add_cascade(label="File", menu=fileMenu)
		
		fileMenu2 = Menu(menubar, tearoff=0)
		fileMenu2.config(font=("Helvetica", 14, "italic"))
		fileMenu2.add_command(label="Set Parameters", command=self.quit)
		menubar.add_cascade(label="Parameters", menu=fileMenu2)

		lbl1 = Label(self.parent, 
			text="Gas Network", 
			fg = "black", 
			font=("Helvetica", 14, "bold"))
	        lbl1.grid(sticky="N", pady=4, padx=5, row=0, column=0, columnspan=2)

		self.f = plt.figure(figsize=(5,4), dpi=80)
		self.cmap = plt.cm.jet #ok
		self.a = self.f.add_subplot(111)
		self.a.axis([-1, 1, -1, 1])
		self.a.axis('off')

		self.canvas = FigureCanvasTkAgg(self.f, master=self.parent)
		self.G = nx.Graph()
		nx.draw_networkx(self.G, pos=nx.spring_layout(self.G), ax=self.a)
		self.canvas.show()
		self.canvas.get_tk_widget().config(width=800-20, height=600-100)
		self.canvas.get_tk_widget().grid(sticky="NW", pady=4, padx=5, row=1, column=0, columnspan=6, rowspan=6) 
		self.txt = Text(self.parent, width=54, height=33);
		self.txt.grid(sticky="NW", pady=4, padx=5, row=1, column=8, columnspan=4, rowspan=6)	

		self.log = Text(self.parent, width=112, height=6);
		self.log.grid(sticky="NW", pady=4, padx=5, row=7, column=0, columnspan=6,rowspan=2)

		RunButton = Button(self.parent, text="Run", width=10, command=self.onRun).grid(sticky='SW', pady=4, padx=5, row=7, column=8)
		DrawButton = Button(self.parent, text="Draw", width=10, command=self.onDraw).grid(sticky='SW', pady=4, padx=5, row=7, column=9)
		StopButton = Button(self.parent, text="Stop", width=10, command=self.onStop).grid(sticky='SW', pady=4, padx=5, row=8, column=9)
		QuitButton = Button(self.parent, text="Quit", width=10, command=self.quit ).grid(sticky='SW', pady=4, padx=5, row=7, column=10)
		self.Loaded = False
		self.Animate = False
Example #21
0
    def initUI(self):
        self.parent.title("Simple Menu")

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="File", menu=fileMenu)
Example #22
0
    def initUI(self):
        self.parent.title("Simple Menu")

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu()
        fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="file", menu=fileMenu)
Example #23
0
    def __init__(self, application):#, frame):
#    def __init__(self, tkroot, application):#, frame):

        # Keep a reference to the input frame
#        frame = frame

#        d = Detector(Detector.SOUTH_SMALL)

        # Create the menu bar and add it to the tkroot

        menu = Menu(application)
        application.config(menu = menu)
#        menu = Menu(tkroot)
#        tkroot.config(menu = menu)

        # Create the various drop-downs - file, edit...

        # Create the "file" menu, with commands like "Open" and "Quit"
        file_menu = Menu(menu)
#        file_menu.add_command(label = 'greeting', command = application.say_hi)
#        file_menu.add_command(label = 'insult', command = application.say_insult)
        file_menu.add_command(label = 'Save', command=application.save_all)
        file_menu.add_command(label = 'Export ROOT file', command=application.save_root)
        file_menu.add_command(label = 'Export PostScript file', command=application.save_postscript)
        file_menu.add_command(label = 'Open', command=application.read_input)
        file_menu.add_separator()
        file_menu.add_command(label = 'Quit', command = application.exit)
#        file_menu.add_command(label='Dialog', menu=open_dialog)

        # Creates the "edit" menu
        view_menu = Menu(menu)
#        view_menu.add_command(label='Change small cells',
#                                   command = application.calibrate_all_small)
        view_menu.add_command(label = 'NSTB', command = application.image_window.display_detector)
        view_menu.add_command(label = 'QT Slots', command = application.image_window.display_qt_boards)
        view_menu.add_separator()
        view_menu.add_command(label = 'Large Cell Voltages', command = application.image_window.display_large_voltage)
        view_menu.add_command(label = 'Small Cell Voltages', command = application.image_window.display_small_voltage)
        view_menu.add_command(label = 'Bitshifts', command = application.image_window.display_qt_bitshift)
        view_menu.add_command(label = 'Gains', command = application.image_window.display_gain)
        # Add a drop-down sub-menu to edit allowing to change
        # either all the small or all the large voltages using
        # an input file.
#        edit_change_submenu = Menu(view_menu);
#        edit_change_submenu.add_command(label='Change small cells',
#                                   command = application.calibrate_all_small)
#        edit_change_submenu.add_command(label='Change large cells',
#                                   command = application.calibrate_all_small)

        edit_menu = Menu(menu)
        edit_menu.add_command(label='Modify gains', command=application.apply_corrections_from_file)

        # Add each drop-down to its parent
        menu.add_cascade(label = 'File', menu = file_menu)
        menu.add_cascade(label = 'View', menu = view_menu)
        menu.add_cascade(label = 'Edit', menu = edit_menu)
Example #24
0
 def __add_menu(self):
     menubar = Menu(self.__main_window)
     file_menu = Menu(menubar, tearoff=0)
     file_menu.add_command(label="New", command=self.__menu_new_pressed)
     file_menu.add_command(label="Save", command=self.__menu_save_pressed)
     file_menu.add_command(label="Save As..",
                           command=self.__menu_save_as_pressed)
     file_menu.add_command(label="Load", command=self.__menu_load_pressed)
     file_menu.add_command(label="Exit")
     menubar.add_cascade(label="File", menu=file_menu)
     self.__main_window.config(menu=menubar)
Example #25
0
def principal():
    top = Tkinter.Tk()
    menubar = Menu(top)
    menubar.add_command(label="Indexar", command=index)
    bm = Menu(menubar, tearoff=0)
    bm.add_command(label="Por texto", command=lambda: buscar("texto"))
    bm.add_command(label="Por fecha", command=lambda: buscar("fecha"))
    bm.add_command(label="Spam", command=lambda: buscar("spam"))
    menubar.add_cascade(label="Buscar", menu=bm)
    top.config(menu=menubar)
    top.mainloop()
Example #26
0
    def __makeMenu(self):
        top = Menu(self.tkRoot)  # top level
        self.tkRoot.config(menu=top)  # set its menu option

        file = Menu(top)
        file.add_command(label="Stop checks",
                         command=self.__thChecker.bypassExecution)
        file.add_command(label="Resume checks",
                         command=self.__thChecker.resumeExecution)
        file.add_command(label="Exit", command=self.__onClose)
        top.add_cascade(label="File", menu=file, underline=0)
Example #27
0
        def set_up_GUI():
            menuBar = Menu(self)
            self.master.config(menu=menuBar)
            fileMenu = Menu(menuBar, tearoff=0)
            menuBar.add_cascade(label="File", menu=fileMenu)
            fileMenu.add_command(label="New", command=self.new_game)
            fileMenu.add_command(label="Exit", command=self.exit)
            fileMenu.insert_separator(fileMenu.index(END))

            self.labelframe = Frame(self.master)
            self.labelframe.grid(column=0, row=0, sticky="W", padx=13)
Example #28
0
    def setup_gui(self):
        # set up the gui
 
        # root is the Tkinter root widget
        self.root.title("Remote Monitor for Pi Presents")

        # self.root.configure(background='grey')

        self.root.resizable(False,False)

        # define response to main window closing
        self.root.protocol ("WM_DELETE_WINDOW", self.app_exit)

        # bind some display fields
        self.desc=StringVar()
        self.filename = StringVar()
        self.display_show = StringVar()
        self.results = StringVar()
        self.status = StringVar()

        # define menu
        menubar = Menu(self.root)

        osc_configmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
        menubar.add_cascade(label='Options', menu = osc_configmenu)
        osc_configmenu.add_command(label='Edit', command = self.e_edit_osc)

        helpmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
        menubar.add_cascade(label='Help', menu = helpmenu)
        helpmenu.add_command(label='Help', command = self.show_help)
        helpmenu.add_command(label='About', command = self.about)
         
        self.root.config(menu=menubar)

        # info frame
        info_frame=Frame(self.root,padx=5,pady=5)
        info_frame.pack(side=TOP, fill=BOTH, expand=1)
        info_name = Label(info_frame, text="Slave Unit's Name: "+self.osc_config.this_unit_name,font="arial 12 bold")
        info_name.pack(side=TOP)
        info_this_address = Label(info_frame, textvariable=self.desc,font="arial 12 bold")
        info_this_address.pack(side=TOP)

        
        # status_frame      
        status_frame=Frame(self.root,padx=5,pady=5)
        status_frame.pack(side=TOP, fill=BOTH, expand=1)
        status_label = Label(status_frame, text="Status:",font="arial 12 bold")
        status_label.pack(side=LEFT)
        scrollbar = Scrollbar(status_frame, orient=VERTICAL)
        self.status_display=Text(status_frame,height=20, yscrollcommand=scrollbar.set)
        scrollbar.config(command=self.status_display.yview)
        scrollbar.pack(side=RIGHT, fill=Y)
        self.status_display.pack(side=LEFT,fill=BOTH, expand=1)
Example #29
0
    def __init__(self):
        root = Tk()
        root.title('FINDME3')
        root.geometry()
        self.root = root
        self.ini = 0
        self.ACC = np.zeros((len(names), ))
        self.trained = [False for i in names]
        self.outliers = [[] for i in names]
        choose = [self._choose(i) for i in range(9)]
        label1 = Label(root, text="input ontology:")
        label2 = Label(root, text="LIMIT:")
        entry1 = Entry(root, bd=5)
        entry2 = Entry(root, bd=3)
        menubar_method = Menu(root, bd=0)
        menusub = Menu(menubar_method, tearoff=0)
        for i in range(len(names)):
            menusub.add_command(label=names[i], command=choose[i])
        menubar_method.add_cascade(label='Method', menu=menusub)
        button1_1 = Button(root, command=self.cin, text='run')
        button1_2 = Button(root, command=self.root.destroy, text='exit')
        button1_3 = Button(root, command=self.available, text='Available')
        button1_4 = Button(root, command=self.train, text='Train&Test')
        button1_5 = Button(root, command=self.listall, text='List all ACC')
        button1_6 = Button(root,
                           command=self.outlier,
                           text='List outliers\n of this method')
        text1 = Text(root,
                     yscrollcommand=True,
                     xscrollcommand=True,
                     wrap='none')
        scr1_1 = Scrollbar(root)
        scr1_2 = Scrollbar(root, orient=HORIZONTAL)
        scr1_1['command'] = text1.yview
        scr1_2['command'] = text1.xview

        text1.configure(yscrollcommand=scr1_1.set, xscrollcommand=scr1_2.set)
        self.configs={'label1':label1\
                      ,'label2':label2\
                      ,'entry1':entry1\
                      ,'entry2':entry2\
                      ,'button1_1':button1_1\
                      ,'button1_2':button1_2\
                      ,'button1_3':button1_3\
                      ,'button1_4':button1_4\
                      ,'button1_5':button1_5\
                      ,'button1_6':button1_6\
                      ,'text1':text1\
                      ,'scr1_1':scr1_1\
                      ,'scr1_2':scr1_2\
                      ,'menu':menubar_method}
        self.display1()
        self.root.config(menu=menubar_method)
Example #30
0
def setup_menu(main_window):
    global mw
    mw = main_window

    menubar = Menu(mw)

    helpmenu = Menu(menubar, tearoff=0)
    helpmenu.add_command(label="Keyboard Control", command=show_keyboard_control_dialog)
    helpmenu.add_command(label="About", command=show_about_dialog)
    menubar.add_cascade(label="Help", menu=helpmenu)

    mw.config(menu=menubar)
def main():
    root = tk.Tk(className="My First Python Editor")
    textPad = st.ScrolledText(root, width=100, height=30)
    textPad.pack()

    menu = Menu(root)
    root.config(menu=menu)
    fileMenu = Menu(menu)

    menu.add_cascade(label="File", menu=fileMenu)

    root.mainloop()
def main():
	root = tk.Tk(className="My First Python Editor")
	textPad = st.ScrolledText(root, width=100, height=30)
	textPad.pack()

	menu = Menu(root)
	root.config(menu=menu)
	fileMenu = Menu(menu)

	menu.add_cascade(label="File", menu=fileMenu)

	root.mainloop()	
Example #33
0
    def initUI(self):
        self.parent.title("File dialog")
        self.pack(fill=BOTH, expand=1)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Open", command=self.onOpen)
        menubar.add_cascade(label="File", menu=fileMenu)

        self.txt = Text(self)
        self.txt.pack(fill=BOTH, expand=1)
    def __init__(self):
        root = Tk()
        root.title("split data")
        root.geometry("200x200")
        menu = Menu(root)
        root.config(menu=menu)
        filemenu = Menu(menu)
        menu.add_cascade(label="File", menu=filemenu)
        filemenu.add_command(label="Load data",command = self.load_data)
        self.notifcation = Label(root,text="")
        self.notifcation.grid(row=0,column=0)

        root.mainloop()
Example #35
0
def display_gui(web='',dept=1):
    global app, link, depthname
    app =  Tkinter.Tk()
    app.title("LINK ANALYSER")
    app.geometry('450x300+200+200')

    menubar = Menu(app)
    filemenu = Menu(menubar, tearoff=0)
    filemenu.add_command(label="Quit", command=app.quit)
    menubar.add_cascade(label="File", menu=filemenu)

    helpmenu = Menu(menubar, tearoff=0)
    helpmenu.add_command(label="About Us", command=aboutProject)
    menubar.add_cascade(label="Help", menu=helpmenu)

    app.config(menu=menubar)

    headertext2 = Tkinter.StringVar()
    headertext2.set("")
    label10 = Tkinter.Label(app,textvariable=headertext2,height=1)
    label10.pack()

    headertext = Tkinter.StringVar()
    headertext.set("")
    label0 = Tkinter.Label(app,textvariable=headertext,height=4)
    label0.pack()

    labeltext = Tkinter.StringVar()
    labeltext.set("Website url")
    label1 = Tkinter.Label(app,textvariable=labeltext,height=1)
    label1.pack()

    url = Tkinter.StringVar(None)
    url.set(web)
    link = Tkinter.Entry(app,textvariable=url,)
    link.pack()

    labeltext = Tkinter.StringVar()
    labeltext.set("Depth")
    label1 = Tkinter.Label(app,textvariable=labeltext,height=1)
    label1.pack()

    deptvalue = Tkinter.IntVar(None)
    deptvalue.set(dept)
    depthname = Tkinter.Entry(app,textvariable=deptvalue,text=dept)
    depthname.pack()

    button1 = Tkinter.Button(app,text="Submit",width=20,command=changeLabel)
    button1.pack(side='bottom' ,padx=15,pady=15)

    app.mainloop()
Example #36
0
    def initUI(self):
      
        self.parent.title("CS 560 Homework")
        
        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        self.label = Label(self.parent)
        
        # File Menu
        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Load", command=self.onLoad)
        fileMenu.add_command(label="Save", command=self.onSave)
        fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="File", menu=fileMenu)

        # Homework 1 Menu
        hw1Menu = Menu(menubar)
        hw1Menu.add_command(label="Gray Scale", command=self.onGray)
        hw1Menu.add_command(label="Resize Image", command=self.onResize)
        hw1Menu.add_command(label="Connect Component", command=self.onConnectedComponent)

        morphologicalMenu = Menu(fileMenu)
        morphologicalMenu.add_command(label="Threshold", command=self.onThreshold)
        morphologicalMenu.add_command(label="Erode", command=self.onErode)
        morphologicalMenu.add_command(label="Dilate", command=self.onDilate)
        morphologicalMenu.add_command(label="Open", command=self.onOpen)
        morphologicalMenu.add_command(label="Close", command=self.onClose)

        hw1Menu.add_cascade(label='Morphological Operations', menu=morphologicalMenu, underline=0)

        hw1Menu.add_command(label="Smooth", command=self.onSmooth)
        hw1Menu.add_command(label="Blur", command=self.onBlur)
        hw1Menu.add_command(label="Equalize the Histogram", command=self.onEqualizeHist)
        hw1Menu.add_command(label="Otsu's method", command=self.onOtsu)
        menubar.add_cascade(label="Homework 1", menu=hw1Menu)

        # Homework 2 Menu
        hw2Menu = Menu(menubar)
        hw2Menu.add_command(label="Extract Apple", command=self.onAppleExtraction)
        hw2Menu.add_command(label="Extract Coins", command=self.onCoinExtraction)
        hw2Menu.add_command(label="Extract Line", command=self.onLineExtraction)

        menubar.add_cascade(label="Homework 2", menu=hw2Menu)

        # Homework 3 Menu
        hw3Menu = Menu(menubar)
        hw3Menu.add_command(label="PCA Computation", command=self.onPCACompute)
        hw3Menu.add_command(label="Eigenfaces")

        menubar.add_cascade(label="Homework 3", menu=hw3Menu)
def createmenubar(_root_window_, _listofentriesdicts_):
    ''' under development 
    input format example: 
        <class app>
        [{ 'title' : 'Title1', 'title_com' : (print , '>command11<') },
        { 'title' : 'Title2',
        'cascade' : (('cnd_label' ,'>command31<'),('cnd_label' ,'>command33<'),
        ('separator'),('cnd_label' ,'>command33<'))}]
    '''
    # using list of list instead dict because an order is needed
    # First create the menu bar
    menu_bar = Menu(_root_window_)  # menubar "object"
    _root_window_.config(menu=menu_bar)

    for i in range(len(_listofentriesdicts_)):
        entry_dict = _listofentriesdicts_[i]
        if 'title_com' in entry_dict.keys():
            _com_ = entry_dict['title_com']
            if len(_com_) > 1:
                menu_bar.add_command(label=entry_dict['title'],
                                     command=(lambda com=_com_: com[0]
                                              (com[1])))
            else:
                menu_bar.add_command(label=entry_dict['title'],
                                     command=_com_[0])

        elif 'cascade' in entry_dict.keys():
            # allocating space
            sub_menu = Menu(menu_bar)
            # Create a menu button labeled "File" as example, that brings up a
            # menu this comes in the entry_dict['title']
            if 'titlei' in entry_dict.keys():
                menu_bar.add_cascade(image=entry_dict['titlei'], menu=sub_menu)
            else:
                menu_bar.add_cascade(label=entry_dict['title'], menu=sub_menu)
            # Create cascades in menus
            content = entry_dict['cascade']
            for cc in range(len(content)):
                _ccc_ = content[cc]

                if len(_ccc_) == 3:
                    sub_menu.add_command(label=content[cc][0],
                                         command=(lambda com=_ccc_: _ccc_[1]
                                                  (_ccc_[2])))
                elif len(_ccc_) == 2:
                    sub_menu.add_command(label=content[cc][0],
                                         command=_ccc_[1])
                else:
                    sub_menu.add_separator()
        else:
            print ' - incomplete data - '
Example #38
0
    def initUI(self):

        self.parent.title("Graphs")
        self.style = Style()
        self.style.theme_use("clam")
        self.pack(fill=BOTH, expand=1)

        self.columnconfigure(1, weight=1)
        self.columnconfigure(3, weight=1)
        self.columnconfigure(6, pad=7)
        self.rowconfigure(3, weight=1)
        self.rowconfigure(5, pad=7)

        menu = Menu(self.parent)
        self.parent.config(menu=menu)
        filemenu = Menu(menu)
        menu.add_cascade(label="File", menu=filemenu)
        filemenu.add_command(label="Load data", command=self.load_data)
        filemenu.add_command(label="Test data", command=self.load_test_data)

        action_menu = Menu(menu)
        menu.add_cascade(label="Process", menu=action_menu)
        action_menu.add_command(label="Dendogram",
                                command=self.calculate_differance)

        # lable to show current file and chanel
        self.file_lbl = Label(self, text="")
        self.file_lbl.grid(row=0, column=3, pady=4, padx=5)

        # list box fro data files
        self.file_list = ScrolledList(self, lambda x: self.load_pvr_data(x))
        self.file_list.grid(row=1,
                            column=0,
                            columnspan=3,
                            rowspan=4,
                            padx=5,
                            sticky=E + W + S + N)

        # chanel graph viewer
        self.graph_viewer = TkinterGraph(self)
        self.graph_viewer.grid(row=1,
                               column=3,
                               columnspan=2,
                               rowspan=4,
                               padx=5,
                               sticky=E + W + S + N)

        # frames for the classifier for the two chanels
        self.frame_left = Frame(self, borderwidth=1)
        self.frame_right = Frame(self, borderwidth=1)
        self.frame_left.grid(row=5, column=3, columnspan=2, rowspan=1)
Example #39
0
    def initUI(self):

        self.parent.title("Ganador del sorteo!")
        self.pack(fill=BOTH, expand=1)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Abrir", command=self.onOpen)
        menubar.add_cascade(label="Archivo", menu=fileMenu)        

        self.txt = Text(self)
        self.txt.pack(fill=BOTH, expand=1)
Example #40
0
 def _setup_menu(self):
   """
   Sets up a menu that lets the user save the proto board we are visualizing as
       a CMax file.
   """
   menu = Menu(self._parent, tearoff=0)
   save_menu = Menu(menu, tearoff=0)
   save_menu.add_command(label='Save as CMax file',
       command=self._save_as_cmax_file)
   menu.add_cascade(label='File', menu=save_menu)
   edit_menu = Menu(menu, tearoff=0)
   edit_menu.add_command(label='Redraw wires', command=self._redraw_wires)
   menu.add_cascade(label='Edit', menu=edit_menu)
   self._parent.config(menu=menu)
    def initUI(self):

        self.parent.title("Convertir Excel en CSV")
        self.pack(fill=BOTH, expand=1)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)
        fileMenu = Menu(menubar)

        fileMenu.add_command(label="Ouvrir", command=self.onOpen)
        menubar.add_cascade(label="Fichier", menu=fileMenu)

        self.txt = Text(self)
        self.txt.pack(fill=BOTH, expand=1)
 def _setup_menu(self):
     """
 Sets up a menu that lets the user save the proto board we are visualizing as
     a CMax file.
 """
     menu = Menu(self._parent, tearoff=0)
     save_menu = Menu(menu, tearoff=0)
     save_menu.add_command(label='Save as CMax file',
                           command=self._save_as_cmax_file)
     menu.add_cascade(label='File', menu=save_menu)
     edit_menu = Menu(menu, tearoff=0)
     edit_menu.add_command(label='Redraw wires', command=self._redraw_wires)
     menu.add_cascade(label='Edit', menu=edit_menu)
     self._parent.config(menu=menu)
Example #43
0
    def initUI(self):
      
        self.parent.title("Simple CSV parser GUI")
        self.pack(fill=BOTH, expand=1)
        
        menu = Menu(self.parent)
        self.parent.config(menu=menu)
        
        filemenu = Menu(menu)
        menu.add_cascade(label="File"        , menu=filemenu)
        
        fileOpenMenu = Menu(filemenu)
        filemenu.add_cascade(label="Open..." , menu=fileOpenMenu)
        fileOpenMenu.add_command(label="CSV..." , command=self.open_reqCSVcommand)

        fileSaveMenu = Menu(filemenu)
        filemenu.add_cascade(label="Save..." , menu=fileSaveMenu)
        fileSaveMenu.add_command(label="CSV..." , command=self.save_reqCSVcommand)
        fileSaveMenu.add_command(label="DOX..." , command=self.save_reqDOXcommand)
        fileSaveMenu.add_command(label="MM..."  , command=self.save_reqMMcommand)
        
        filemenu.add_separator()
        filemenu.add_command(label="Exit"    , command=self.exit_command)
        
        helpmenu = Menu(menu)
        menu.add_cascade(label="Help"        , menu=helpmenu)
        helpmenu.add_command(label="About...", command=self.about_command)
        # end of menu creation       
        
        self.txt = Text(self)
        self.txt.pack(fill=BOTH, expand=1)
Example #44
0
def addMenuBar(root, pane):
    global mainPane
    mainPane = pane
    menubar = Menu(root)
    filemenu = Menu(menubar, tearoff=0)
    filemenu.add_command(label="Character Generator", command=lambda:launchPane(root,mainPane,CharacterPane))
    filemenu.add_command(label="Weather Generator", command=lambda:launchPane(root,mainPane,WeatherPane))
    filemenu.add_command(label="Town Generator", command=lambda:launchPane(root,mainPane,TownPane))
    filemenu.add_command(label="Inn Generator", command=lambda:launchPane(root,mainPane,InnPane))
    filemenu.add_command(label="Event Generator", command=lambda:launchPane(root,mainPane,EventPane))
    filemenu.add_command(label="Plot Generator", command=lambda:launchPane(root,mainPane,PlotPane))
    filemenu.add_command(label="Statistics Mode", command=lambda:launchPane(root,mainPane,StatsPane))
    menubar.add_cascade(label="File",menu=filemenu)
    root.config(menu=menubar)
Example #45
0
 def onRightClick(self, event):
     if self.slot.status != 'Empty':
         popup = Menu(self,tearoff=0)
         unloadmenu = Menu(self, tearoff = 0)
         for slot in self.slot.device.storage_slots:
             if slot.status == 'Empty':
                 unloadmenu.add_command(label= u'storage slot %s' % slot.slot,
                     command=partial(self.menu_action, slot.slot))
         popup.add_cascade(label='unload',menu =unloadmenu)
         try:
             popup.tk_popup(event.x_root, event.y_root, 0)
         finally:
             popup.grab_release()
             self.updated()
    def _init_menu(self):
        toplevel = self.winfo_toplevel()
        self._menu = Menu(toplevel)
        toplevel['menu'] = self._menu

        view = Menu(self._menu, tearoff=0)
        self._menu.add_cascade(label="View", menu=view)

        graph_view = Menu(view, tearoff=0)
        view.add_cascade(label="View graphs", menu=graph_view)

        graph_view.add_radiobutton(variable="graphframeview", label="Only one", value="onlyone")
        #        graph_view.add_radiobutton(label="In a row", value="row",
        #            variable=graph_view_var)
        graph_view.add_radiobutton(variable="graphframeview", label="In separate window", value="window")
Example #47
0
 def initUI(self):
   
     self.parent.title("File dialog")
     self.pack(fill=BOTH, expand=1)
     
     menubar = Menu(self.parent)
     self.parent.config(menu=menubar)
     
     fileMenu = Menu(menubar)
     fileMenu.add_command(label="Open", command=self.onOpen)
     menubar.add_cascade(label="File", menu=fileMenu)        
     
     self.txt = Text(self)
     #This is the Text widget in which we will show the contents of a selected file.
     self.txt.pack(fill=BOTH, expand=1)
Example #48
0
    def initUI(self):

        self.parent.title("File dialog")
        self.pack(fill=BOTH, expand=1)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Open", command=self.onOpen)
        menubar.add_cascade(label="File", menu=fileMenu)

        # This is the text widget which will show the contents of a selected file.
        self.txt = Text(self)
        self.txt.pack(fill=BOTH, expand=1)
Example #49
0
def principal():
    top = Tkinter.Tk()
    menubar = Menu(top)
    dm = Menu(menubar, tearoff=0)
    dm.add_command(label="Cargar", command=index)
    dm.add_command(label="Salir", command=top.destroy)
    menubar.add_cascade(label="Datos", menu=dm)

    bm = Menu(menubar, tearoff=0)
    bm.add_command(label="Noticia", command=lambda: buscar("noticia"))
    bm.add_command(label="Fecha", command=lambda: buscar("fecha"))
    bm.add_command(label="Autor", command=lambda: buscar("autor"))
    menubar.add_cascade(label="Buscar", menu=bm)
    top.config(menu=menubar)
    top.mainloop()
Example #50
0
    def initUI(self):

        self.parent.title("CDR Report Generator")
        self.pack(fill=BOTH, expand=1)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Raw CDR", command=self.onOpen)
        menubar.add_cascade(label="Choose CDR to Clean.", menu=fileMenu)
        fileMenu.add_command(label="Exit", command=self.onExit)

        self.txt = Text(self)
        self.txt.pack(fill=BOTH, expand=1)
Example #51
0
    def initUI(self):

        self.parent.title("File auswaehlen")
        self.pack(fill=BOTH, expand=1)

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="open file", command=self.onOpen)
        menubar.add_cascade(label="click here to start", menu=fileMenu)
        self.pack(fill=BOTH, expand=1)

        self.txt = Text(self)
        #self.txt.pack(fill=BOTH, expand=1)
        self.txt.pack()
    def startUI(self):

        self.parent.title("Simple menu")

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Exit", command=self.onExit)
        fileMenu.add_command(label="Bebs", command=self.bebs)

        helpMenu = Menu(menubar)
        helpMenu.add_command(label="help", command=self.help)

        menubar.add_cascade(label="File", menu=fileMenu)
        menubar.add_cascade(label="Help", menu=helpMenu)
Example #53
0
    def initUI(self):

        self.parent.title("Main")
        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)  #menu item 1
        configMenu = Menu(menubar)  # menu item 2

        #menu item 1
        menubar.add_cascade(label="File", menu=fileMenu)
        fileMenu.add_command(label="Exit", command=self.onExit)

        # menu item 2
        menubar.add_cascade(label="Config", menu=configMenu)
        configMenu.add_command(label="Config GPIO", command=config)
Example #54
0
    def initUI(self):

        self.parent.title("Typesetting")

        self.min_margin = 10
        self.max_margin = 100
        self.margin_value = self.min_margin
        self.words = []

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)
        fileMenu.add_command(label="Open", command=self.openfile)
        fileMenu.add_command(label="Clear", command=self.clear)
        fileMenu.add_separator()
        fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="File", menu=fileMenu)

        grid = Frame(self.parent)
        left_grid = Frame(grid)
        w_list_label = Label(left_grid,text="Lista de palabras")
        w_list_label.pack(side=TOP)
        self.w_list = MultiListbox(left_grid,(("Palabra",20),("Longitud",10)))
        self.w_list.pack(side=BOTTOM,fill=BOTH,expand=TRUE)
        left_grid.pack(side=LEFT,fill=BOTH,expand=TRUE)


        right_grid = Frame(grid)
        up_grid = Frame(right_grid)
        margin_label = Label(up_grid,text="Margen")
        margin_label.pack(side=LEFT,expand=TRUE)
        self.margin_scale = Scale(up_grid,orient=HORIZONTAL,showvalue=0,\
            variable=self.margin_value,from_=self.min_margin,to=self.max_margin,
            command=self.refresh_margin)
        self.margin_scale.pack(side=LEFT)
        self.margin_spinbox = Spinbox(up_grid,\
            textvariable=self.margin_value,from_=self.min_margin,to=self.max_margin)
        self.margin_spinbox.pack(side=LEFT)
        typeset_btn = Button(up_grid, text ="Typeset", command =self.typeset)
        typeset_btn.pack(side=RIGHT)
        up_grid.pack(side=TOP)

        self.text = Text(right_grid)
        self.text.pack(side=BOTTOM,fill=BOTH,expand=TRUE)
        right_grid.pack(side=RIGHT,fill=BOTH)
        grid.pack(fill=BOTH, expand=YES)