本文整理汇总了Python中Tkinter.Tk.geometry方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.geometry方法的具体用法?Python Tk.geometry怎么用?Python Tk.geometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.Tk
的用法示例。
在下文中一共展示了Tk.geometry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
global cnx
root = Tk()
root.geometry("900x600+100+100")
cnx = conectar()
app = Example(root)
root.mainloop()
示例2: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
x_size = 0
y_size = 0
gates = []
ports = []
root = Tk()
layout_fl = open(os.path.dirname(os.path.abspath(__file__)) \
+ "/layout.txt","r")
for ln in layout_fl:
is_match = re.match(r"x_size(\d+)y_size(\d+)",ln)
if (is_match):
x_size = int(is_match.group(1))
y_size = int(is_match.group(2))
is_match = re.match(r"gatename(.+)x(\d+)y(\d+)",ln)
if(is_match):
gate = is_match.group(1),\
int(is_match.group(2)),\
int(is_match.group(3))
gates.append(gate)
is_match = re.match(r"portname(.+)x(\d+)y(\d+)",ln)
if(is_match):
port = is_match.group(1),\
int(is_match.group(2)),\
int(is_match.group(3))
ports.append(port)
sz = ""
sz = str(x_size*scale_c+2*margin) + "x" + \
str(y_size*scale_c+2*margin)
#sz = "800x450"
grid = x_size,y_size
ex = Draw_Layout(root,grid,gates,ports)
#root.bind('<Key>',key);
root.geometry(sz)
root.mainloop()
示例3: initializeGUI
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def initializeGUI(game_state):
global state
state = game_state
root = Tk()
qgui = QuestionGUI(root)
root.geometry("1300x700+0+0")
return qgui, root
示例4: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
root = Tk()
root.geometry('640x480')
root.title("odeint GUI")
center(root)
odeintgui = OdeIntGui(root)
root.mainloop()
示例5: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
root = Tk()
root.geometry("500x350+300+300")
app = Example(root)
root.mainloop()
示例6: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
root = Tk()
root.geometry("350x300+300+300")
#root.iconbitmap(os.path.abspath(os.curdir+"\Assets\Alien_robot.ico"))
app = Window(root)
root.mainloop()
示例7: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
root = Tk()
if platform.system()!="Darwin":
MyHwCtrl = Hardware_control()
MyHwCtrl.go_to_base()
root.geometry("480x320")
root.wm_title('Medimi')
if len(sys.argv) > 1 and sys.argv[1] == 'fs':
root.wm_attributes('-fullscreen', True)
os = platform.system()
print os
if platform.system()!="Darwin":
app = PiMenu(root, MyHwCtrl)
else:
print "Runnning on Mac"
app = PiMenu(root,None)
# myClock = Clock(root)
# root.bind("<Button-1>", callback, root) #
# myClock.tick()
root.mainloop()
示例8: optionFilter
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def optionFilter():
global racine
racine = Tk()
fenetre = filterswindow(racine)
racine.geometry("500x300+200+0")
racine.mainloop()
示例9: f10_1
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def f10_1():
def fe():
root4.destroy()
begin_lon = 0
try:
begin_lon = (float)(E1.get())
except:
print 'no enter a float number'
print begin_lon
c.execute('DELETE FROM info WHERE latitude>?', (begin_lon,))
conn.commit()
DBtoCSV()
root2.destroy()
root4 = Tk()
root4.title("end time")
root4.geometry("600x200")
ButtonCSV = Button(root4, text="convert to csv", width=100, fg='red', font=16, command=DBtoCSV2)
ButtonCSV.pack()
ButtonKML = Button(root4, text="convert to kml", width=100, fg='red', font=16, command=DBtoKML)
ButtonKML.pack()
ButtonEXIT = Button(root4, text="exit", width=100, fg='red', font=16, command=fe)
ButtonEXIT.pack()
示例10: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
root = Tk()
# w, h = root.winfo_screenwidth(), root.winfo_screenheight()
w, h = 960, 540
# get value from arduino
# ser = serial.Serial('/dev/tty.usbserial', 9600)
pos = 0
root.overrideredirect(1)
root.focus_set()
root.bind("<Escape>", lambda e: e.widget.quit())
root.geometry("%dx%d+300+300" % (w, h))
canvas = Canvas(root, width=w, height=h, background="black")
rect0 = canvas.create_rectangle(w/2-75, h/2-20, w/2+75, h/2+20, fill="#05f", outline="#05f")
rect1 = canvas.create_rectangle(w/2-20, h/2-75, w/2+20, h/2+75, fill="#05f", outline="#05f")
canvas.pack()
while (True):
# gets angle and moves accordingly
# pos = ser.readline()
canvas.move(rect0, 1, 0)
canvas.move(rect1, 1, 0)
root.update()
root.after(30)
app = App(root)
time.sleep(0.5)
root.mainloop()
示例11: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
""" Main method of everything """
#print "\t Starting ... in time: ", strftime("%a, %d %b %Y %X", gmtime()), "\n"
#print "\t Running ... in time: ", strftime("%a, %d %b %Y %X", gmtime()), "\n"
#print "\t Recording ... in time: ", strftime("%Y-%m-%d %H:%M:%S", gmtime()), "\n"
#print "\t Ending ... in time: ", strftime("%Y-%m-%d %H:%M:%S", gmtime()), "\n"
# create the root window
root = Tk()
# modify the window
root.title("Auto visual police system")
root.geometry("1000x800")
Button(root, text="Ukončit celý system", command=root.destroy).pack()
for cam in xrange(numberOfCams):
Button(root, text="Kamera číslo: "+str(cam), command=root.destroy).pack(padx=5, pady=10, fill=X, side="left")
# Start the window's event-loop
root.mainloop()
示例12: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
root = Tk()
root.geometry("900x650+300+20")
app = Example(root)
root.mainloop()
示例13: init_master
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def init_master():
"""初始化主窗口"""
global master
master = Tk()
master.title(u'花田')
master.geometry(u'630x530')
master.resizable(width=False, height=False)
示例14: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def main():
DEFAULTVALUE_OPTION = 'Restart (choose color from list)'
root = Tk()
root.title('Lets Play Alien Tiles!')
root.geometry('478x340')
root.configure(background='black')
row = 1
global buttons
for i in range(7):
for j in range(7):
b = tk.Button(text="0",command= lambda x1=i, y1=j: pressed(x1,y1), bg = 'red', width=5)
b.grid(row = i, column = j)
buttons.append(b)
pattern = tk.Label(text="Pattern")
pattern.grid( row = 8, column = 2, columnspan=3, sticky=W+E)
global entry
entry = tk.Entry(bd =5)
entry.grid(row=9, column = 1, columnspan=5, sticky=W+E)
bo = tk.Button(text="Original Page",command=web)
bo.grid( row = 14, column = 5, columnspan=2, padx = 15, pady = 15)
optionList = ('Restart (choose color from list)','red', 'green', 'blue', 'purple')
global v
v = StringVar()
v.set(optionList[0])
defaultOption = StringVar()
om = OptionMenu(root, v, *optionList)
defaultOption.set(DEFAULTVALUE_OPTION)
om.grid( row = 13, column = 0, columnspan=4, pady = 10)
confirm = tk.Button(text="Confirm",command=restart)
confirm.grid( row = 14, column = 1, columnspan=2)
confirm.place(anchor= SE, x=160, y=320)
root.mainloop()
示例15: _replace_dialog
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import geometry [as 别名]
def _replace_dialog(parent):
root = Tk()
root.title("Test ReplaceDialog")
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
root.geometry("+%d+%d"%(x, y + 150))
# mock undo delegator methods
def undo_block_start():
pass
def undo_block_stop():
pass
text = Text(root)
text.undo_block_start = undo_block_start
text.undo_block_stop = undo_block_stop
text.pack()
text.insert("insert","This is a sample string.\n"*10)
def show_replace():
text.tag_add(SEL, "1.0", END)
replace(text)
text.tag_remove(SEL, "1.0", END)
button = Button(root, text="Replace", command=show_replace)
button.pack()