本文整理汇总了Python中tkinter.Tk.grid_rowconfigure方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.grid_rowconfigure方法的具体用法?Python Tk.grid_rowconfigure怎么用?Python Tk.grid_rowconfigure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Tk
的用法示例。
在下文中一共展示了Tk.grid_rowconfigure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import grid_rowconfigure [as 别名]
def main(cls):
"Create context for demo and run a test instance."
NoDefaultRoot()
root = Tk()
root.minsize(420, 330)
root.title('Markov Demo 2')
test = cls(root)
test.grid(sticky=NSEW)
root.grid_rowconfigure(0, weight=1)
root.grid_columnconfigure(0, weight=1)
root.mainloop()
示例2: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import grid_rowconfigure [as 别名]
def main(cls):
# Create the application's root.
NoDefaultRoot()
root = Tk()
# Restrict sizing and add title.
root.minsize(350, 175)
root.title('Directory Size')
# Create the application's icon.
with open('tree.ico', 'wb') as file:
file.write(zlib.decompress(base64.b64decode(ICON)))
root.iconbitmap('tree.ico')
os.remove('tree.ico')
# Configure the SizeTree object.
view = cls(root)
view.grid(row=0, column=0, sticky=NSEW)
# Setup the window for resizing.
root.grid_rowconfigure(0, weight=1)
root.grid_columnconfigure(0, weight=1)
# Enter the GUI main event loop.
root.mainloop()
示例3: GUI
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import grid_rowconfigure [as 别名]
class GUI(object):
'''Stellt die Oberflaeche dar.
Alle steuerden Taetigkeiten werden (sollten) vom
Controller Objekt uebernommen werden.
'''
def __init__(self):
'''
Constructor
'''
self.root = Tk()
self.root.title("DinnerLog")
self.root.minsize(800, 600)
self.root.grid_columnconfigure(0, weight=1)
self.root.grid_rowconfigure(0, weight=1)
self.root.grid_rowconfigure(1, weight=3)
# Ein Frame für alles, das mit Zutaten zu tun hat
self.fr_zutaten = Labelframe(self.root, borderwidth=2, relief=GROOVE, text="Zutaten")
self.fr_zutaten.grid_columnconfigure(0, weight=1)
self.fr_zutaten.grid_rowconfigure(0, weight=1)
self.fr_zutaten.grid(row=0, column=0, sticky="NSWE")
self.lb_zutaten = Listbox(self.fr_zutaten)
sb_zutaten = Scrollbar(self.lb_zutaten, orient=VERTICAL)
self.lb_zutaten.configure(yscrollcommand=sb_zutaten.set)
sb_zutaten.config(command=self.lb_zutaten.yview)
sb_zutaten.pack(side="right", fill="both")
self.lb_zutaten.grid(row=0, column=0, sticky="NSEW")
self._addNeueZutatFrame()
# Ein Frame in den alles, das mit Mahlzeiten zu tun hat, kommt
self.fr_mahlzeit = Labelframe(self.root, borderwidth=2, relief=GROOVE, text="Mahlzeiten")
self.fr_mahlzeit.grid_columnconfigure(0, weight=1)
self.fr_mahlzeit.grid_rowconfigure(0, weight=1)
self.fr_mahlzeit.grid(row=1, column=0, sticky="NSWE")
self._addNeueMahlzeitFrame()
self.lb_mahlzeiten = Listbox(self.fr_mahlzeit, selectmode=SINGLE)
sb_mahlzeiten = Scrollbar(self.lb_mahlzeiten, orient=VERTICAL)
sb_mahlzeiten.configure(command=self.lb_mahlzeiten.yview)
self.lb_mahlzeiten.configure(yscrollcommand=sb_mahlzeiten.set)
sb_mahlzeiten.pack(side="right", fill="both")
self.lb_mahlzeiten.grid(row=0, column=0, sticky="NSEW")
fr_neu_ok = Frame(self.fr_mahlzeit)
fr_neu_ok.grid(row=1, column=0, columnspan=2, sticky="E")
self.btn_neu = Button(fr_neu_ok, text="Neu")
self.btn_neu.pack(side="left")
self.btn_mahlzeit_als_zt = Button(fr_neu_ok, text="Als Zutat")
self.btn_mahlzeit_als_zt.pack(anchor=E, side="right")
self.btn_insert = Button(fr_neu_ok, text="Hinzufuegen")
self.btn_insert.pack(anchor=E, side="right")
self.btn_update = Button(fr_neu_ok, text="Update")
self.btn_update.pack(anchor=E, side="right")
self.btn_delete = Button(fr_neu_ok, text="Loeschen")
self.btn_delete.pack(anchor=E, side="right")
# Ein Frame der Statistiken darstellt
self.fr_stats = Labelframe(self.root, borderwidth=2, relief=GROOVE, text="Statistik")
self.fr_stats.grid(row=3, column=0, sticky="NSWE")
#self.cv_stats = Canvas(self.fr_stats, height=80, width=600)
#self.cv_stats.create_line(2,5,598,5, fill="#bbb")
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)
#.........这里部分代码省略.........