本文整理汇总了Python中tkinter.Tk.maxsize方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.maxsize方法的具体用法?Python Tk.maxsize怎么用?Python Tk.maxsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Tk
的用法示例。
在下文中一共展示了Tk.maxsize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: demo
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
def demo():
"""
Main program to handle command line parameters and then run what they want.
"""
from tkinter import Tk
if BibleOrgSysGlobals.verbosityLevel > 0: print( ProgNameVersion )
#if BibleOrgSysGlobals.verbosityLevel > 1: print( " Available CPU count =", multiprocessing.cpu_count() )
print( exp("Running {} demo…").format( ProgName ) )
tkRootWindow = Tk()
# Calls to the window manager class (wm in Tk)
tkRootWindow.geometry( "{}x{}+{}+{}".format( 320, 100, 2000, 100 ) ) # width, height, xOffset, yOffset
tkRootWindow.title( ProgNameVersion )
tkRootWindow.minsize( 300, 50 )
tkRootWindow.maxsize( 400, 200 )
#geometryMap = parseWindowGeometry( tkRootWindow.winfo_geometry() )
#print( "geometry", geometryMap )
#for something in geometryMap:
#print( repr(something) )
settings = ApplicationSettings( 'BiblelatorData/', 'BiblelatorSettings/', ProgName )
settings.load()
print( str(settings) )
print( repr(settings) )
#tkRootWindow.destroy() # Useful if we want to measure the start-up time
# Start the program running
tkRootWindow.mainloop()
示例2: open_main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
def open_main():
btn_dims = int(settings["gui"]["btn_dims"])
_xt_root = Tk()
if settings["gui"]["bypass_wm"] == "1":
_xt_root.overrideredirect(1)
_xt_root.title("Xtouchy Toolbox")
_xt_root.maxsize(btn_dims * 3, btn_dims * 3)
root_frame = ttk.Frame(_xt_root, padding="0 0 0 0", width=btn_dims * 3, height=btn_dims * 3)
root_frame.grid(column=1, row=0, sticky=("N", "W", "E", "S"))
# Screen orientation
wrkbtn = ttk.Button(root_frame, width=2, text="↑", command=lambda: rotate(0, _xt_root))
wrkbtn.place(x=btn_dims, y=0, width=btn_dims, height=btn_dims)
wrkbtn = ttk.Button(root_frame, width=2, text="↓", command=lambda: rotate(2, _xt_root))
wrkbtn.place(x=btn_dims, y=btn_dims * 2, width=btn_dims, height=btn_dims)
wrkbtn = ttk.Button(root_frame, width=2, text="←", command=lambda: rotate(1, _xt_root))
wrkbtn.place(x=0, y=btn_dims, width=btn_dims, height=btn_dims)
wrkbtn = ttk.Button(root_frame, width=2, text="→", command=lambda: rotate(3, _xt_root))
wrkbtn.place(x=btn_dims * 2, y=btn_dims, width=btn_dims, height=btn_dims)
# Close/Move button
mvbtn = ttk.Button(root_frame, width=2, text="⇱")
mvbtn.bind("<B1-Motion>", lambda x: move(x, _xt_root))
mvbtn.place(x=0, y=0, width=btn_dims, height=btn_dims)
ttk.Button(root_frame, width=2, text="X", command=lambda: reset_and_exit(_xt_root)).place(
x=btn_dims * 2, y=0, width=btn_dims, height=btn_dims
)
# Toggle virtual keyboard
tvkbtn = ttk.Button(root_frame, width=2, text="K")
tvkbtn.bind("<B1-Motion>", lambda x: move_vkeyboard(x, _xt_root))
tvkbtn.place(x=0, y=btn_dims * 2, width=btn_dims, height=btn_dims)
_xt_root.mainloop()
示例3: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
def main():
'''Makes the application
'''
root = Tk()
app = Application(master=root)
app.master.title("Password Generator")
root.minsize(500, 500)
root.maxsize(600, 600)
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="Exit", command=root.destroy)
menubar.add_cascade(label="File", menu=filemenu)
root.config(bg='#2A2C2B', menu=menubar)
app.mainloop()
示例4: __init__
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
def __init__(self, lineThickness=3, maxH=1920, maxW=1080):
master = Tk()
master.maxsize(maxH, maxW)
self.localCanvas = Canvas(master, width=400, height=400)
self.currentlyRenderedWindow = None
self.lineThickness = lineThickness
self.vsb = Scrollbar(master, orient="vertical", command=self.localCanvas.yview)
self.hsb = Scrollbar(master, orient="horizontal", command=self.localCanvas.xview)
self.localCanvas.configure(yscrollcommand=self.vsb.set)
self.localCanvas.configure(xscrollcommand=self.hsb.set)
master.bind("<Configure>", self.__eventOnFrameConfigure)
self.hsb.pack(side="bottom", fill="x")
self.vsb.pack(side="right", fill="y")
self.localCanvas.pack()
self.__sampleDraw()
''''''
示例5: Config
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
#.........这里部分代码省略.........
self.ui_dblbl = Label(self.ui_midframe, text="Database name",
justify=LEFT, anchor=W, font=font )
self.ui_dblbl.grid(row=3, column=0, padx=2, pady=2)
self.ui_db = Entry(self.ui_midframe, font=font)
self.ui_db.grid(row=3, column=1, padx=2, pady=2)
# OUT
self.ui_outlbl = Label(self.ui_midframe, text="Audio output (local/hdmi)",
justify=LEFT, anchor=W, font=font )
self.ui_outlbl.grid(row=4, column=0, padx=2, pady=2)
self.ui_out = Entry(self.ui_midframe, font=font)
self.ui_out.grid(row=4, column=1, padx=2, pady=2)
# OPT
self.ui_optlbl = Label(self.ui_midframe, text="Omxplayer extra options",
justify=LEFT, anchor=W, font=font )
self.ui_optlbl.grid(row=5, column=0, padx=2, pady=2)
self.ui_opt = Entry(self.ui_midframe, font=font)
self.ui_opt.grid(row=5, column=1, padx=2, pady=2)
# URL1L
self.ui_url1llbl = Label(self.ui_midframe, text="Url 1 name",
justify=LEFT, anchor=W, font=font )
self.ui_url1llbl.grid(row=6, column=0, padx=2, pady=2)
self.ui_url1l = Entry(self.ui_midframe, font=font)
self.ui_url1l.grid(row=6, column=1, padx=2, pady=2)
# URL1
self.ui_url1lbl = Label(self.ui_midframe, text="Url 1",
justify=LEFT, anchor=W, font=font )
self.ui_url1lbl.grid(row=7, column=0, padx=2, pady=2)
self.ui_url1 = Entry(self.ui_midframe, font=font)
self.ui_url1.grid(row=7, column=1, padx=2, pady=2)
# URL2L
self.ui_url2llbl = Label(self.ui_midframe, text="Url 2 name",
justify=LEFT, anchor=W, font=font )
self.ui_url2llbl.grid(row=8, column=0, padx=2, pady=2)
self.ui_url2l = Entry(self.ui_midframe, font=font)
self.ui_url2l.grid(row=8, column=1, padx=2, pady=2)
# URL2
self.ui_url2lbl = Label(self.ui_midframe, text="Url 2",
justify=LEFT, anchor=W, font=font )
self.ui_url2lbl.grid(row=9, column=0, padx=2, pady=2)
self.ui_url2 = Entry(self.ui_midframe, font=font)
self.ui_url2.grid(row=9, column=1, padx=2, pady=2)
# URL3L
self.ui_url3llbl = Label(self.ui_midframe, text="Url 3 name",
justify=LEFT, anchor=W, font=font )
self.ui_url3llbl.grid(row=10, column=0, padx=2, pady=2)
self.ui_url3l = Entry(self.ui_midframe, font=font)
self.ui_url3l.grid(row=10, column=1, padx=2, pady=2)
# URL3
self.ui_url3lbl = Label(self.ui_midframe, text="Url 3",
justify=LEFT, anchor=W, font=font )
self.ui_url3lbl.grid(row=11, column=0, padx=2, pady=2)
self.ui_url3 = Entry(self.ui_midframe, font=font)
self.ui_url3.grid(row=11, column=1, padx=2, pady=2)
# URL4L
self.ui_url4llbl = Label(self.ui_midframe, text="Url 4 name",
justify=LEFT, anchor=W, font=font )
self.ui_url4llbl.grid(row=12, column=0, padx=2, pady=2)
self.ui_url4l = Entry(self.ui_midframe, font=font)
self.ui_url4l.grid(row=12, column=1, padx=2, pady=2)
# URL4
self.ui_url4lbl = Label(self.ui_midframe, text="Url 4",
justify=LEFT, anchor=W, font=font )
self.ui_url4lbl.grid(row=13, column=0, padx=2, pady=2)
self.ui_url4 = Entry(self.ui_midframe, font=font)
self.ui_url4.grid(row=13, column=1, padx=2, pady=2)
# URL5L
self.ui_url5llbl = Label(self.ui_midframe, text="Url 5 name",
justify=LEFT, anchor=W, font=font )
self.ui_url5llbl.grid(row=14, column=0, padx=2, pady=2)
self.ui_url5l = Entry(self.ui_midframe, font=font)
self.ui_url5l.grid(row=14, column=1, padx=2, pady=2)
# URL5
self.ui_url5lbl = Label(self.ui_midframe, text="Url 5",
justify=LEFT, anchor=W, font=font )
self.ui_url5lbl.grid(row=15, column=0, padx=2, pady=2)
self.ui_url5 = Entry(self.ui_midframe, font=font)
self.ui_url5.grid(row=15, column=1, padx=2, pady=2)
# Bottom Frame (buttons group)
self.ui_botframe = Frame(self.root, borderwidth=2)
self.ui_botframe.pack(anchor='s')
# Button Save
self.ui_butsave = Button(self.ui_botframe, text="Save",
command=self.save, font=font)
self.ui_butsave.grid(row=1, column=0, padx=2, pady=2)
# Button Close
self.ui_butquit = Button(self.ui_botframe, text="Close",
command=self.root.destroy, font=font)
self.ui_butquit.grid(row=1, column=1, padx=2, pady=2)
# Window position
self.root.update_idletasks()
w = self.root.winfo_reqwidth()
h = self.root.winfo_reqheight()
ws = self.root.winfo_screenwidth()
hs = self.root.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
self.root.geometry('%dx%d+%d+%d' % (w, h, x, y))
self.root.minsize(w, h)
self.root.maxsize(w, h)
return(True)
示例6: App
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
class App(object):
def __init__(self):
#настройка окружения
self.pathtoapp = path2program.abspath(".")
self.lst = [x for x in listdir(".") if ".prg" in x] #получаем список файлов с расширением prg
if len(self.lst)==0:
print("No prg file found in directory")
input()
_exit(0)
self.currentfileindex = 0 #устанавливаем индекс текущего файла
#настройка графики
self.window = Tk()
self.window.title("PRG Viewer by Novicov: "+self.pathtoapp)
w = 850
h = 500
self.window.minsize(width=w-100,height=h-100)
self.window.maxsize(width=w,height=h)
#иконка
_lst = sys_argv[0].split('\\')
self.window.iconbitmap('\\'.join(_lst[:-1])+'\\PRGViewer-logo.ico')
#ПАНЕЛИ
# self.leftframe = Frame(self.window, bg="blue", width=int(w*0.667),height=h)
self.leftframe = Frame(self.window, bg="grey", width=int(w*0.667),height=h)
# self.bottomleftframe = Frame(self.leftframe, bg="red", width=w//4, height=int(h*0.2))
self.bottomleftframe = Frame(self.leftframe, bg="grey", width=w//4, height=int(h*0.2))
# self.rightframe = Frame(self.window, bg="yellow",width=int(w*0.333),height=h)
self.rightframe = Frame(self.window, bg="dark grey",width=int(w*0.333),height=h)
#canvas
self.set_canvas( self.leftframe, bg="dark green", width=int(w*0.667),height=int(h*0.8))
# self.set_canvas( self.leftframe, bg="light green", width=100,height=100)
#кнопки
self.nextButton = Button(self.bottomleftframe,text="Next",width=10)
self.prevButton = Button(self.bottomleftframe,text="Prev",width=10)
#Список фильтров
self.Filter = PRGListBox(self.rightframe,width=w-500)
#Выбор файла платы
self.infoText = StringVar()
self.infoText.set("Current file: "+self.lst[self.currentfileindex])
self.info = Label(self.rightframe,text=self.infoText.get())
self.listFilesText = StringVar()
self.listFilesText.set("\n".join(["Files: "]+self.lst))
self.listfiles = Label(self.rightframe,text=self.listFilesText.get(),anchor="w",justify=LEFT)
self.helpText = Label(self.rightframe, text="Use Next/Prev (Pg Down/Up) buttons for change file\n"+
"Use Up,Down,Right,Left buttons for move field\n"+
"Select row in ListBox for change vision mode\n"+
"Use +/- (p/m) buttons for scaling of field",anchor="n",justify=LEFT)
def set_path_and_current(self, filename):
'''
эта функция обрабатывает полный путь до файла
'''
try:
_lst = filename.split('\\')
self.path = '\\'.join(_lst[:-2])
chdir('\\'.join(_lst[:-1]))
print(listdir("."))
self.lst = [x for x in listdir(".") if ".prg" in x]
self.currentfileindex = self.lst.index(_lst[-1])
self.infoText.set("Current file: "+self.lst[self.currentfileindex])
self.info.configure(text=self.infoText.get())
self.listFilesText.set("\n".join(self.lst))
self.listfiles.configure(text=self.listFilesText.get())
self.canvas.configure(self.lst[self.currentfileindex])
self.canvas.setdefault(reper=True)
#рисуем
self.canvas.paint()
#здесь мы создаем группу
gr = list()
for item in self.canvas.field:
print(item[2][2])
if not (item[2][2] in gr):#выделяем уникальные данные
gr.append(item[2][2])
self.Filter.lst.delete(2,END)
for item in gr:
self.Filter.lst.insert(END,item)
except IOError:
self.infoText.set("Error")
self.info.configure(text=self.infoText.get())
def set_canvas(self,master=None,height=500,width=500,bg="grey" ):
if master==None:
master=self.window
self.canvas = prgCanvas(master,height=height,width=width,bg=bg)
def nextprev(self,direction):
self.currentfileindex+=1 if abs(direction)==direction else -1
#.........这里部分代码省略.........
示例7: WindowApp
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import maxsize [as 别名]
class WindowApp(object):
"""
The PDF Stampede app window
"""
def __init__(self, resizable=(True, True), geometry=(620, 220)):
assert (isinstance(resizable, (tuple, list)))
assert (isinstance(geometry, (tuple, list)))
self.root = Tk()
self.config = configparser.ConfigParser()
self.config_file_name = "config.ini"
self.config.read(self.config_file_name)
self.default_case = StringVar(value=self.config["DEFAULT"].get("case", "CASE"))
self.default_team = StringVar(value=self.config["DEFAULT"].get("team", "TEAM"))
self.default_series = StringVar()
self.default_last_index = StringVar()
self.root.title("The Stampede")
self.root.resizable(width=resizable[0], height=resizable[1])
self.root.geometry('{}x{}'.format(geometry[0], geometry[1]))
self.root.minsize(geometry[0], geometry[1])
self.root.maxsize(geometry[0]+200, geometry[1])
self.file_name = StringVar()
self.file_name.trace("w", self.file_name_changed)
self.stamp_button = None
self.add_widgets()
self.add_menus()
self.center(self.root)
def add_widgets(self):
# File
frame = Frame(self.root)
frame.pack(side=TOP, fill=X, expand=True, ipady=5)
file_label = Label(frame, text="PDF File", width=10)
file_label.pack(side=LEFT, padx=5, pady=5)
file_entry = Entry(frame, state=DISABLED, textvariable=self.file_name)
file_entry.pack(padx=5, side=LEFT, fill=X, expand=True)
file_button = Button(frame, text="Browse...", command=self.choose_pdf)
file_button.pack(padx=5, side=RIGHT)
# Case
frame = Frame(self.root)
frame.pack(side=TOP, fill=X, expand=True)
case_label = Label(frame, text="Case", width=10)
case_label.pack(side=LEFT, padx=5, pady=5)
case_entry = Entry(frame, textvariable=self.default_case)
case_entry.pack(fill=X, padx=5, expand=True)
# Team
frame = Frame(self.root)
frame.pack(fill=BOTH, expand=True)
team_label = Label(frame, text="Team", width=10)
team_label.pack(side=LEFT, padx=5, pady=5)
team_entry = Entry(frame, textvariable=self.default_team)
team_entry.pack(fill=X, padx=5, expand=True)
# Series
frame = Frame(self.root)
frame.pack(fill=BOTH, expand=True)
series_label = Label(frame, text="Series", width=10)
series_label.pack(side=LEFT, padx=5, pady=5)
series_entry = Entry(frame, textvariable=self.default_series)
series_entry.pack(fill=X, padx=5, expand=True)
# Last index
frame = Frame(self.root)
frame.pack(fill=BOTH, expand=True)
last_index_label = Label(frame, text="Last index", width=10)
last_index_label.pack(side=LEFT, padx=5, pady=5)
last_index_entry = Entry(frame, textvariable=self.default_last_index)
last_index_entry.pack(fill=X, padx=5, expand=True)
bottom_frame = Frame(self.root)
bottom_frame.pack(side=BOTTOM, fill=X, ipady=5, padx=5)
close_button = Button(bottom_frame, text="Quit", command=self.root.quit)
close_button.pack(side=RIGHT)
self.stamp_button = Button(bottom_frame, text="Stamp it!", state=DISABLED, command=self.stamp_it)
self.stamp_button.pack(side=RIGHT)
def stamp_it(self):
stamp_it(
self.file_name.get(),
self.default_case.get(),
self.default_team.get(),
self.default_series.get(),
self.default_last_index.get(),
)
def add_menus(self):
menu_bar = Menu(self.root)
stampede_menu = Menu(menu_bar, tearoff=0)
stampede_menu.add_command(label="Settings", command=self.edit_default_settings)
stampede_menu.add_separator()
stampede_menu.add_command(label="Quit", command=self.root.quit)
menu_bar.add_cascade(label="Stampede", menu=stampede_menu)
self.root.config(menu=menu_bar)
#.........这里部分代码省略.........