本文整理汇总了Python中ttk.Button.place方法的典型用法代码示例。如果您正苦于以下问题:Python Button.place方法的具体用法?Python Button.place怎么用?Python Button.place使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ttk.Button
的用法示例。
在下文中一共展示了Button.place方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("Batch Geocoder")
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
quitButton = Button(self, text="Quit", command=self.quit)
quitButton.place(x=50, y=50)
menubar = Menu(self.parent)
self.parent.config(menu=menubar)
scrollbar = Scrollbar(self)
scrollbar.pack( side = RIGHT, fill=Y)
fileMenu = Menu(menubar)
fileMenu.add_command(label="Run", command=self.onOpen)
fileMenu.add_command(label="Exit", underline=0, command=self.onExit)
menubar.add_cascade(label="File", menu=fileMenu)
#menubar.add_command(label="Run", command=self.runScript)
self.txt = Text(self, yscrollcommand = scrollbar.set)
scrollbar.config( command = self.txt.yview )
self.txt.pack(fill=BOTH, expand=1)
示例2: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("FirstGUI")
self.pack(fill=BOTH, expand=1)
quitButton = Button(self, text="Quit", command=self.quit)
quitButton.place(x=100, y=100)
示例3: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("Example")
self.pack(fill=BOTH, expand = 1)
self.style = Style()
self.style.theme_use("default")
frame = Frame(self, relief=Tkinter.RAISED, borderwidth=1)
frame.pack(fill=BOTH, expand=1)
okButton = Button(self, text = "OK")
okButton.place(x = self.width - 200, y = self.height - 100)
quitButton = Button(self.parent, text = "QUIT")
quitButton.place(x = self.width - 100, y = self.height - 100)
scale = 0.75
self.wow_pic = Image.open("hd_1.jpg")
self.wow_pic = self.wow_pic.resize((int(self.width*scale), int(self.height*scale)))
self.wow_pic_tk = ImageTk.PhotoImage(self.wow_pic)
self.label_wow_pic = Label(self, image = self.wow_pic_tk)
self.label_wow_pic.image = self.wow_pic_tk
self.label_wow_pic.place(x = 10, y = 10)
info_x = int(self.width*scale) + 20
label_text_area = Tkinter.Label(self, text = "Message received:")
label_text_area.place(x = info_x, y = 10)
self.text_area = Tkinter.Text(self, height = 10, width = 40)
self.text_area.place(x = info_x, y = 30)
示例4: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self,parent):
self.parent.title("Quit Button")
self.style= Style()
self.style.theme_use("default")
self.pack(fill=BOTH,expand=1)
quitbutton=Button(self,text="Quit",command=parent.destroy)
quitbutton.place(x=50,y=50)
示例5: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("Simple")
self.pack(fill=BOTH, expand=1)
self.centerWindow()
quitButton = Button(self, text="Quit", command=self.quit)
quitButton.place(x=50, y=50)
示例6: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title('Simple')
self.style = Style()
self.style.theme_use('default')
self.pack(fill=BOTH, expand=1)
# self.centerWindow()
quitButton = Button(self, text='Quit', command=self.quit)
quitButton.place(x=50, y=50)
示例7: init_ui
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def init_ui(self):
self.parent.title("knn - Classification")
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
self.center_window()
quit_button = Button(self, text="Close", command=self.quit)
quit_button.place(x=50, y=50)
示例8: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("Sample Button")
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
quitButton = Button(self, text="Quit", command=self.quit)
quitButton.place(x=50, y=50)
示例9: add_button
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def add_button(self, name, func, loc, **kwargs):
"""Adds a button in the desired location of the SubFrame"""
# set title of button
print (func, kwargs)
button = Button(self, text=name, command=func, **kwargs)
# place the button
button.place(x=loc[0], y=loc[1])
示例10: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("Quit button")
# Styling the frame
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
quitButton = Button(self, text="Quit",command=self.quit)
quitButton.place(x=100, y=100)
示例11: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("We shall eat")
self.style = Style()
self.style.theme_use("aqua")
self.pack(fill=BOTH, expand=1)
quitButton = Button(self, text="%s" % restaurant,
command=self.quit)
quitButton.place(x=50, y=50)
示例12: __init__
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.parent.title("Centered Window with quit button")
self.style=Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
self.centerWindow()
quitButton = Button(self,text="Quit",command=self.quit)
quitButton.place(x=50,y=50)
示例13: initUI
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def initUI(self):
self.parent.title("Calendar Entry")
self.style = Style()
self.style.theme_use("alt")
self.pack(fill = BOTH, expand = 1)
quitButton = Button(self, text = "Quit", command = self.quit)
quitButton.place(x = 425, y = 475)
# def googleLogin(self):
entry = Entry(self)
entry.place(x = 200, y = 70)
username = entry.get()
示例14: backButton
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def backButton(self):
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
backButton = Button(self, text="<-- Back", command=callInputWindow)
# to calculate where to put button
x1 = w/16 - 10
y1 = h/5
backButton.place(x=x1, y=y1)
示例15: startButton
# 需要导入模块: from ttk import Button [as 别名]
# 或者: from ttk.Button import place [as 别名]
def startButton(self):
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
startButton = Button(self, text="Start -->", command=startMonitor)
# to calculate where to put button
x1 = w - w/3 + 10
y1 = h/5
startButton.place(x=x1, y=y1)