示例#1
0
    def create_widgets(self, names):
        ''' Creates appropriate widgets.

            Args:
                names (list of str): list of available sheet names.
        '''
        sheet_name_lbl = Label(self,
                               text='Choose sheet name where data is stored:')
        sheet_name_lbl.grid(sticky=N + W, padx=5, pady=5)
        sheet_names_box = Combobox(self,
                                   state="readonly",
                                   width=20,
                                   textvariable=self.sheet_name_str,
                                   values=names)
        sheet_names_box.current(0)
        sheet_names_box.grid(row=1,
                             column=0,
                             columnspan=2,
                             sticky=N + W,
                             padx=5,
                             pady=5)
        ok_btn = Button(self, text='OK', command=self.ok)
        ok_btn.grid(row=2, column=0, sticky=N + E, padx=5, pady=5)
        ok_btn.bind('<Return>', self.ok)
        ok_btn.focus()
        cancel_btn = Button(self, text='Cancel', command=self.cancel)
        cancel_btn.grid(row=2, column=1, sticky=N + E, padx=5, pady=5)
        cancel_btn.bind('<Return>', self.cancel)
示例#2
0
文件: gui.py 项目: jwdafoe/DrvTool
 def show_about(self):
     about = Toplevel(self.master)
     about.title('About {}'.format(self.version[:-5]))
     about.focus()
     about.resizable(0, 0)
     logo_lbl = Label(about, image=self.logo)
     logo_lbl.image = self.logo
     logo_lbl.grid(row=0, column=0, padx='7 11', pady=13, sticky='n')
     about_frame = Frame(about, padding='0 10 10 10')
     about_frame.grid(row=0, column=1)
     Label(about_frame, text=self.version).grid(sticky='w')
     Label(about_frame, text='Developer:  Joel W. Dafoe').grid(pady='6', sticky='w')
     link = Link(about_frame, text='http://cyberdatx.com', foreground='blue', cursor='hand2')
     link.grid(sticky='w')
     link.bind('<Button-1>', lambda e: webbrowser.open('http://cyberdatx.com'))
     Label(about_frame, text=self.description, wraplength=292).grid(columnspan=2, pady=6, sticky='w')
     cls_btn = Button(about_frame, text='OK', command=about.destroy)
     cls_btn.grid(column=1, sticky='e')
     cls_btn.focus()
     about.bind('<Return>', lambda e: cls_btn.invoke())
示例#3
0
    def create_widgets(self, names):
        ''' Creates appropriate widgets.

            Args:
                names (list of str): list of available sheet names.
        '''
        sheet_name_lbl = Label(self,
                               text='Choose sheet name where data is stored:')
        sheet_name_lbl.grid(sticky=N+W, padx=5, pady=5)
        sheet_names_box = Combobox(self, state="readonly", width=20,
                                   textvariable=self.sheet_name_str,
                                   values=names)
        sheet_names_box.current(0)
        sheet_names_box.grid(row=1, column=0, columnspan=2,
                             sticky=N+W, padx=5, pady=5)
        ok_btn = Button(self, text='OK', command=self.ok)
        ok_btn.grid(row=2, column=0, sticky=N+E, padx=5, pady=5)
        ok_btn.bind('<Return>', self.ok)
        ok_btn.focus()
        cancel_btn = Button(self, text='Cancel', command=self.cancel)
        cancel_btn.grid(row=2, column=1, sticky=N+E, padx=5, pady=5)
        cancel_btn.bind('<Return>', self.cancel)