当前位置: 首页>>代码示例>>Python>>正文


Python Label.grid方法代码示例

本文整理汇总了Python中tkinter.ttk.Label.grid方法的典型用法代码示例。如果您正苦于以下问题:Python Label.grid方法的具体用法?Python Label.grid怎么用?Python Label.grid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tkinter.ttk.Label的用法示例。


在下文中一共展示了Label.grid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _addNeueMahlzeitFrame

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def _addNeueMahlzeitFrame(self):
        self.fr_neue_mz = Frame(self.fr_mahlzeit)
        self.fr_neue_mz.grid_rowconfigure(2, weight=1)
        self.fr_neue_mz.grid(row=0, column=1, sticky="WSNE")
        
        lbl_name = Label(self.fr_neue_mz, text="Name:")
        lbl_name.grid(row=0, column=0, sticky="NW")
        
        self.en_name = Entry(self.fr_neue_mz)
        self.en_name.grid(row=0, column=1, columnspan=2, sticky="WNE")
        
        lbl_zutat = Label(self.fr_neue_mz, text="Zutaten:")
        lbl_zutat.grid(row=1, column=0, sticky="NW")
        

        self.lb_zutat = Listbox(self.fr_neue_mz)
        sb_zutat = Scrollbar(self.lb_zutat, orient=VERTICAL)
        self.lb_zutat.configure(yscrollcommand=sb_zutat.set)
        sb_zutat.configure(command=self.lb_zutat.yview)
        sb_zutat.pack(side="right", fill="both")
        self.lb_zutat.grid(row=2, column=0, columnspan=3, sticky="NWSE")
        
        self.var_zutat = StringVar(self.fr_neue_mz)
        
        self.opt_zutat = OptionMenu(self.fr_neue_mz, self.var_zutat, "Auswahl")
        self.opt_zutat.grid(row=3, column=0)
        
        self.en_menge = Entry(self.fr_neue_mz)
        self.en_menge.grid(row=3, column=1)
        
        self.btn_mahlzeit_hinzu = Button(self.fr_neue_mz, text="Hinzu")
        self.btn_mahlzeit_hinzu.grid(row=3, column=2, sticky="E")
开发者ID:karacho84,项目名称:dinnerlog,代码行数:34,代码来源:gui.py

示例2: __init__

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
 def __init__(self, parent, title, imageFile, body):
     super(DialogAbout, self).__init__(parent)
     self.parent = parent
     parentGeometry = re.match("(\d+)x(\d+)[+]?([-]?\d+)[+]?([-]?\d+)", parent.geometry())
     dialogX = int(parentGeometry.group(3))
     dialogY = int(parentGeometry.group(4))
     self.transient(self.parent)
     self.title(title)
     
     frame = Frame(self)
     image = PhotoImage(file=imageFile)
     aboutImage = Label(frame, image=image)
     aboutBody = Label(frame, text=body, wraplength=500)
     okButton = Button(frame, text=_("OK"), command=self.ok)
     okButton.focus_set()
     aboutImage.grid(row=0, column=0, sticky=NW, pady=20, padx=16)
     aboutBody.grid(row=0, column=1, columnspan=2, sticky=EW, pady=3, padx=0)
     okButton.grid(row=1, column=2, sticky=EW, pady=3)
     
     frame.grid(row=0, column=0, sticky=(N,S,E,W))
     frame.columnconfigure(1, weight=1)
     window = self.winfo_toplevel()
     window.columnconfigure(0, weight=1)
     self.geometry("+{0}+{1}".format(dialogX+200,dialogY+200))
     
     self.bind("<Alt-u>", lambda *ignore: okButton.focus_set())
     self.bind("<Return>", self.ok)
     self.bind("<Escape>", self.close)
     
     self.protocol("WM_DELETE_WINDOW", self.close)
     self.grab_set()
     self.wait_window(self)
开发者ID:DaveInga,项目名称:Arelle,代码行数:34,代码来源:DialogAbout.py

示例3: __init__

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
 def __init__(self, master, ordinances=False, **kwargs):
     super(Options, self).__init__(master, **kwargs)
     self.ancestors = IntVar()
     self.ancestors.set(4)
     self.descendants = IntVar()
     self.spouses = IntVar()
     self.ordinances = IntVar()
     self.contributors = IntVar()
     self.start_indis = StartIndis(self)
     self.fid = StringVar()
     btn = Frame(self)
     entry_fid = EntryWithMenu(btn, textvariable=self.fid, width=16)
     entry_fid.bind('<Key>', self.enter)
     label_ancestors = Label(self, text=_('Number of generations to ascend'))
     entry_ancestors = EntryWithMenu(self, textvariable=self.ancestors, width=5)
     label_descendants = Label(self, text=_('Number of generations to descend'))
     entry_descendants = EntryWithMenu(self, textvariable=self.descendants, width=5)
     btn_add_indi = Button(btn, text=_('Add a FamilySearch ID'), command=self.add_indi)
     btn_spouses = Checkbutton(self, text='\t' + _('Add spouses and couples information'), variable=self.spouses)
     btn_ordinances = Checkbutton(self, text='\t' + _('Add Temple information'), variable=self.ordinances)
     btn_contributors = Checkbutton(self, text='\t' + _('Add list of contributors in notes'), variable=self.contributors)
     self.start_indis.grid(row=0, column=0, columnspan=3)
     entry_fid.grid(row=0, column=0, sticky='w')
     btn_add_indi.grid(row=0, column=1, sticky='w')
     btn.grid(row=1, column=0, columnspan=2, sticky='w')
     entry_ancestors.grid(row=2, column=0, sticky='w')
     label_ancestors.grid(row=2, column=1, sticky='w')
     entry_descendants.grid(row=3, column=0, sticky='w')
     label_descendants.grid(row=3, column=1, sticky='w')
     btn_spouses.grid(row=4, column=0, columnspan=2, sticky='w')
     if ordinances:
         btn_ordinances.grid(row=5, column=0, columnspan=3, sticky='w')
     btn_contributors.grid(row=6, column=0, columnspan=3, sticky='w')
     entry_ancestors.focus_set()
开发者ID:daleathan,项目名称:getmyancestors,代码行数:36,代码来源:fstogedcom.py

示例4: initUI

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def initUI(self):

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

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

        lbl = Label(self, text="Windows")
        lbl.grid(sticky=W, pady=4, padx=5)

        area = Text(self)
        area.grid(row=1, column=0, columnspan=2, rowspan=4, padx=5, sticky=E + W + S + N)

        abtn = Button(self, text="Activate")
        abtn.grid(row=1, column=3)

        cbtn = Button(self, text="Close")
        cbtn.grid(row=2, column=3, pady=4)

        hbtn = Button(self, text="Help")
        hbtn.grid(row=5, column=0, padx=5)

        obtn = Button(self, text="OK")
        obtn.grid(row=5, column=3)
开发者ID:Austin-Xie,项目名称:python-cave,代码行数:31,代码来源:Window.py

示例5: initUI

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def initUI(self):
        self.parent.title("Pi computation")
        self.pack(fill=BOTH, expand=True)

        self.grid_columnconfigure(4, weight=1)
        self.grid_rowconfigure(3, weight=1)

        lbl1 = Label(self, text="Digits:")
        lbl1.grid(row=0, column=0, sticky=E, padx=10, pady=10)

        self.ent1 = Entry(self, width=10)
        self.ent1.insert(END, "4000")
        self.ent1.grid(row=0, column=1, sticky=W)

        lbl2 = Label(self, text="Accuracy:")
        lbl2.grid(row=0, column=2, sticky=E, padx=10, pady=10)

        self.ent2 = Entry(self, width=10)
        self.ent2.insert(END, "100")
        self.ent2.grid(row=0, column=3, sticky=W)

        self.startBtn = Button(self, text="Start",
                               command=self.onStart)
        self.startBtn.grid(row=1, column=0, padx=10, pady=5, sticky=W)

        self.pbar = Progressbar(self, mode='indeterminate')
        self.pbar.grid(row=1, column=1, columnspan=3, sticky=W+E)

        self.txt = scrolledtext.ScrolledText(self)
        self.txt.grid(row=2, column=0, rowspan=4, padx=10, pady=5,
                      columnspan=5, sticky=E+W+S+N)
开发者ID:chengyi818,项目名称:kata,代码行数:33,代码来源:1_calculating_pi.py

示例6: __init__

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.master = master
        self.master.title('Moving Files')

        start_label = Label(self.master, text='start location')
        end_label = Label(self.master, text='end location')

        start_label.grid(row=0, column=1)
        end_label.grid(row=2, column=1)

        self.start_label_var = Label(self.master, width=25, anchor=CENTER, relief=RIDGE)
        self.end_label_var = Label(self.master, width=25, anchor=CENTER, relief=RIDGE)

        self.start_label_var.grid(row=1, column=1, padx=(5, 10))
        self.end_label_var.grid(row=3, column=1, padx=(5, 10))

        #-----------------------------------------------------------------
        self.start_point = ''
        self.end_point = ''
        #-----------------------------------------------------------------

        # Start and end location
        start_button = Button(self.master, text='start_location', width=17, command=self.start_location)
        end_button = Button(self.master, text='end location', width=17, command=self.end_location)

        start_button.grid(row=1, column=0, padx=(10, 0))
        end_button.grid(row=3, column=0, padx=(10, 0))

        # Radio buttons and entry fields
        self.radio_button_status = IntVar()
        radio_button_0 = Radiobutton(self.master, \
        text='Put files in folder named as their extension\n(Enter file extensions separated with "space")', variable=self.radio_button_status, value=0, command=self.radio_status)
        radio_button_0.select()
        radio_button_1 = Radiobutton(self.master, text='Associate folder name to extensions\n(images=jpg,png video=mp4)', variable=self.radio_button_status, value=1, command=self.radio_status)
        radio_button_2 = Radiobutton(self.master, text='Just move files. Do not create new folders\n(png jpg mp4)', variable=self.radio_button_status, value=2, command=self.radio_status)

        radio_button_0.grid(row=4, columnspan=2, sticky=W, padx=(10, 0), pady=(5, 0))
        
        self.extension = Entry(self.master, relief=GROOVE, state=NORMAL)

        self.extension.grid(row=5, columnspan=2, padx=(15, 10), pady=(2, 2), sticky=(W, E))
        
        radio_button_1.grid(row=6, columnspan=2, sticky=W, padx=(10, 10))

        self.key_value_entry = Entry(self.master, relief=GROOVE, state=DISABLED)

        self.key_value_entry.grid(row=7, columnspan=2, padx=(15, 10), pady=(2, 2), sticky=(W, E))
        #self.master.rowconfigure(6, weight=1)

        radio_button_2.grid(row=8, columnspan=2, padx=(10, 0), pady=(0, 2), sticky=W)

        self.extension_2 = Entry(self.master, relief=GROOVE, state=DISABLED)

        self.extension_2.grid(row=9, columnspan=2, padx=(15, 10), pady=(2, 10), sticky=(W, E))
        
        # Button for moving files
        move_button = Button(self.master, text='Move Files', width=30, command=self.moving_files)

        move_button.grid(row=10, columnspan=2, pady=(0, 6))
开发者ID:slavko993,项目名称:Moving-Files,代码行数:62,代码来源:moving_files_GUI.py

示例7: __init__

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
        PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
        self.pairs = None
        
        eframe = self.eframe = LabelFrame(self,text="Options") 
        #,fg=textLightColor,bg=baseColor)
        eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
        
        label = Label(eframe,text="Pipeline")#,fg=textLightColor,bg=baseColor)
        label.grid(row=3,column=0,sticky=W,padx=10,pady=5)

        PipelineLabels = ['Initial QC', 
			  'Germline',
			  'Somatic Tumor-Normal',
                          'Somatic Tumor-Only']
        Pipelines=["initialqcgenomeseq",
                   "wgslow", 
		   'wgs-somatic',
                   'wgs-somatic-tumoronly']

        self.label2pipeline = { k:v for k,v in zip(PipelineLabels, Pipelines)}
        PipelineLabel = self.PipelineLabel = StringVar()
        Pipeline = self.Pipeline = StringVar()
        PipelineLabel.set(PipelineLabels[0])
        
        #om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
        om = OptionMenu(eframe, PipelineLabel, *PipelineLabels, command=self.option_controller)
        om.config()#bg = widgetBgColor,fg=widgetFgColor)
        om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
        #om.pack(side=LEFT,padx=20,pady=5)
        om.grid(row=3,column=1,sticky=W,padx=10,pady=5)
开发者ID:jlac,项目名称:Pipeliner,代码行数:33,代码来源:genomeseq.py

示例8: __init__

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
        PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
        self.info = None
        
        eframe = self.eframe = LabelFrame(self,text="Options") 
        #,fg=textLightColor,bg=baseColor)
        eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
        
        label = Label(eframe,text="Pipeline:")#,fg=textLightColor,bg=baseColor)
        label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
        Pipelines=["InitialChIPseqQC", "ChIPseq" ]
        Pipeline = self.Pipeline = StringVar()
        Pipeline.set(Pipelines[0])
        
        om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
        om.config()#bg = widgetBgColor,fg=widgetFgColor)
        om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
        #om.pack(side=LEFT,padx=20,pady=5)
        om.grid(row=3,column=1,sticky=W,padx=20,pady=5)

        readtypes = ['Single', 'Paired']
        self.readtype = readtype = StringVar()
        readtype.set(readtypes[0])
        readtype_menu = OptionMenu(eframe, readtype, *readtypes)
        readtype_menu.grid(row=3, column=3, sticky=E, pady=5)
        readtype_label = Label(eframe, text="-end   ")
        readtype_label.grid( row=3, column=4, stick=W, pady=5)

        self.add_info(eframe)
        self.option_controller()
        self.peakinfo_fn = 'peakcall.tab'
        self.contrast_fn = 'contrast.tab'
开发者ID:felloumi,项目名称:Pipeliner,代码行数:34,代码来源:epigenomeseq.py

示例9: initUI

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def initUI(self):
        self.parent.title("Windows")
        self.style = Style()
        self.style.theme_use("default")
        self.pack(fill=BOTH, expand=1)

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

        lbl = Label(self, text="BookManager")
        lbl.grid(sticky=W, pady=4, padx=5)

        self.area = Text(self) #WHITE TEXT BOX
        self.area.grid(row=1, column=0, columnspan=3, rowspan=4,
            padx=5, sticky=E+W+S+N)

        abtn = Button(self, text="add", command=self.press_add)
        abtn.grid(row=1, column=3)

        srcbtn = Button(self, text="search", command=self.press_search)
        srcbtn.grid(row=2, column=3, pady=3)

        rbtn = Button(self, text="remove", command=self.press_remove)
        rbtn.grid(row=3, column=3, pady=3)

        sbtn = Button(self, text="show all", command=self.press_show)
        sbtn.grid(row=4, column=3, pady=3)
开发者ID:damidam125,项目名称:forPYTHON,代码行数:31,代码来源:make_gui.py

示例10: create_widgets

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def create_widgets(self):
        ''' Creates widgets of this object.
        '''
        yScrollbar = Scrollbar(self, orient=VERTICAL)
        yScrollbar.grid(row=2, column=3, sticky=N+S)

        canvas = StyledCanvas(self, height=HEIGHT_WITHOUT_CHECKBOXES,
                              yscrollcommand=yScrollbar.set)
        self.canvas = canvas
        canvas.grid(row=2, column=0, columnspan=3, sticky=N+E+W)

        self._config_columns(self)
        canvas.columnconfigure(0, weight=1)

        if self.add_headers:
            non_discr_lbl = Label(self, text='Non-\ndiscretionary')
            non_discr_lbl.grid(row=0, column=1, padx=3, pady=1)
            weakly_disp_lbl = Label(self, text='Weakly\ndisposable')
            weakly_disp_lbl.grid(row=0, column=2, padx=3, pady=1)
            sep = Separator(self)
            sep.grid(row=1, column=0, columnspan=3, sticky=E+W, pady=10, padx=3)

        self.frame_with_boxes = Frame(canvas)
        self._config_columns(self.frame_with_boxes)
        self.frame_with_boxes.grid(sticky=N+S+W+E, pady=15, padx=3)

        canvas.create_window(0, 0, window=self.frame_with_boxes, anchor=N+W)
        canvas.update_idletasks()

        canvas['scrollregion'] = (0, 0, 0, HEIGHT_WITHOUT_CHECKBOXES)
        yScrollbar['command'] = canvas.yview

        MouseWheel(self).add_scrolling(canvas, yscrollbar=yScrollbar)
开发者ID:nishimaomaoxiong,项目名称:pyDEA,代码行数:35,代码来源:categories_checkbox_gui.py

示例11: create_widgets

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def create_widgets(self):  # Call from override, if any.
        # Bind to self widgets needed for entry_ok or unittest.
        self.frame = frame = Frame(self, padding=10)
        frame.grid(column=0, row=0, sticky='news')
        frame.grid_columnconfigure(0, weight=1)

        entrylabel = Label(frame, anchor='w', justify='left',
                           text=self.message)
        self.entryvar = StringVar(self, self.text0)
        self.entry = Entry(frame, width=30, textvariable=self.entryvar)
        self.entry.focus_set()
        self.error_font = Font(name='TkCaptionFont',
                               exists=True, root=self.parent)
        self.entry_error = Label(frame, text=' ', foreground='red',
                                 font=self.error_font)
        self.button_ok = Button(
                frame, text='OK', default='active', command=self.ok)
        self.button_cancel = Button(
                frame, text='Cancel', command=self.cancel)

        entrylabel.grid(column=0, row=0, columnspan=3, padx=5, sticky=W)
        self.entry.grid(column=0, row=1, columnspan=3, padx=5, sticky=W+E,
                        pady=[10,0])
        self.entry_error.grid(column=0, row=2, columnspan=3, padx=5,
                              sticky=W+E)
        self.button_ok.grid(column=1, row=99, padx=5)
        self.button_cancel.grid(column=2, row=99, padx=5)
开发者ID:1st1,项目名称:cpython,代码行数:29,代码来源:query.py

示例12: OkFrame

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
class OkFrame(MessageFrame):
    def __init__(self, master, config):
        super(OkFrame, self).__init__(master, config)

        if config.full_screen:
            self._make_full(master)

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

        self._frame_lbl = Label(
            self.master,
            text='',
            anchor='center',
            font=self._config.item_font
        )
        self._frame_lbl.grid(row=0, column=0, sticky='snew')

        self._next_btn = Button(
            self.master,
            text='OK',
            command=self._next_cmd
        )
        self._next_btn.grid(row=1, column=0, sticky='snew')

    def show(master, config, msg):
        new_window = Toplevel(master)
        dlg = OkFrame(new_window, config)
        dlg._frame_lbl['text'] = msg

    def _next_cmd(self):
        self._master.destroy()
开发者ID:aphistic,项目名称:copilot,代码行数:35,代码来源:message.py

示例13: __init__

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
 def __init__(self, parent, url=None, buttonSEC=False, buttonRSS=False):
     super(DialogURL, self).__init__(parent)
     self.parent = parent
     parentGeometry = re.match("(\d+)x(\d+)[+]?([-]?\d+)[+]?([-]?\d+)", parent.geometry())
     dialogX = int(parentGeometry.group(3))
     dialogY = int(parentGeometry.group(4))
     self.accepted = False
     self.url = None
     self.transient(self.parent)
     self.title("Enter URL")
     self.urlVar = StringVar()
     self.urlVar.set(url if url is not None else "http://")
     
     frame = Frame(self)
     urlLabel = Label(frame, text=_("URL:"), underline=0)
     urlEntry = Entry(frame, textvariable=self.urlVar, width=60)
     urlEntry.focus_set()
     okButton = Button(frame, text=_("OK"), command=self.ok)
     cancelButton = Button(frame, text=_("Cancel"), command=self.close)
     if buttonSEC:
         usSecButton = Button(frame, text=_("SEC search"), command=self.usSec)
         usSecButton.grid(row=1, column=1, sticky=W, pady=3)
         ToolTip(usSecButton, text=_("Opens US SEC Edgar Company Search (in web browser)\n\n"
                                  "(1) Find the company in web browser,\n"
                                  "(2) Click 'documents' button for desired filing,\n"
                                  "(3) Find 'data files' panel, instance document row, 'document' column,\n"
                                  "(4) On instance document file name, right-click browser menu: 'copy shortcut',\n"
                                  "(5) Come back to this dialog window,\n"
                                  "(6) Ctrl-v (paste) shortcut into above URL text box,\n"
                                  "(7) Click ok button to load instance document"),
                                  wraplength=480)
     if buttonRSS:
         rssButton = Button(frame, text=_("SEC RSS"), command=self.rssFeed)
         rssButton.grid(row=1, column=1, pady=3)
         ToolTip(rssButton, text=_("Opens current US SEC Edgar RSS feed"),
                                  wraplength=480)
     urlLabel.grid(row=0, column=0, sticky=W, pady=3, padx=3)
     urlEntry.grid(row=0, column=1, columnspan=3, sticky=EW, pady=3, padx=3)
     okButton.grid(row=1, column=2, sticky=E, pady=3)
     ToolTip(okButton, text=_("Opens above URL from web cache, downloading to cache if necessary"), wraplength=240)
     cancelButton.grid(row=1, column=3, sticky=EW, pady=3, padx=3)
     ToolTip(cancelButton, text=_("Cancel operation"))
                 
     frame.grid(row=0, column=0, sticky=(N,S,E,W))
     frame.columnconfigure(1, weight=1)
     window = self.winfo_toplevel()
     window.columnconfigure(0, weight=1)
     self.geometry("+{0}+{1}".format(dialogX+50,dialogY+100))
     
     self.bind("<Alt-u>", lambda *ignore: urlEntry.focus_set())
     self.bind("<Return>", self.ok)
     self.bind("<Escape>", self.close)
     
     self.protocol("WM_DELETE_WINDOW", self.close)
     self.grab_set()
     self.wait_window(self)
开发者ID:Arelle,项目名称:Arelle,代码行数:58,代码来源:DialogURL.py

示例14: ConfirmFrame

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
class ConfirmFrame(MessageFrame):
    def __init__(self, master, config):
        super(ConfirmFrame, self).__init__(master, config)

        if config.full_screen:
            self._make_full(master)

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

        self._result = False

        self._frame_lbl = Label(
            self.master,
            text='',
            anchor='center',
            font=self._config.item_font
        )
        self._frame_lbl.grid(row=0, column=0, columnspan=2, sticky='snew')

        self._prev_btn = Button(
            self.master,
            text='Cancel',
            command=self._prev_cmd
        )
        self._prev_btn.grid(row=1, column=0, sticky='snew')

        self._next_btn = Button(
            self.master,
            text='OK',
            command=self._next_cmd
        )
        self._next_btn.grid(row=1, column=1, sticky='snew')

    def show(master, config, msg, ok_text, cancel_text):
        new_window = Toplevel(master)
        dlg = ConfirmFrame(new_window, config)
        dlg._frame_lbl['text'] = msg
        dlg._prev_btn['text'] = cancel_text
        dlg._next_btn['text'] = ok_text

        dlg.wait_window(new_window)

        return dlg._result

    def _prev_cmd(self):
        self._result = False
        self._master.destroy()
    def _next_cmd(self):
        self._result = True
        self._master.destroy()
开发者ID:aphistic,项目名称:copilot,代码行数:55,代码来源:message.py

示例15: make_entry

# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import grid [as 别名]
    def make_entry(self, label_text, var):
        '''Return (entry, label), .

        entry - gridded labeled Entry for text entry.
        label - Label widget, returned for testing.
        '''
        label = Label(self.top, text=label_text)
        label.grid(row=self.row, column=0, sticky="nw")
        entry = Entry(self.top, textvariable=var, exportselection=0)
        entry.grid(row=self.row, column=1, sticky="nwe")
        self.row = self.row + 1
        return entry, label
开发者ID:1st1,项目名称:cpython,代码行数:14,代码来源:searchbase.py


注:本文中的tkinter.ttk.Label.grid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。