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


Python Button.place方法代码示例

本文整理汇总了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)
开发者ID:Ccantey,项目名称:BatchGeoCode,代码行数:29,代码来源:BatchGeoCode.py

示例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)
开发者ID:mdriller,项目名称:eclipse_workspace,代码行数:9,代码来源:tkinter_test.py

示例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)
开发者ID:Freelectry,项目名称:RPi_pic,代码行数:33,代码来源:guiexample.py

示例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)
开发者ID:shikhagarg0192,项目名称:Python,代码行数:10,代码来源:gui5.py

示例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)
开发者ID:sunshine55,项目名称:python-practice,代码行数:10,代码来源:hellotkinter.py

示例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)
开发者ID:Tigrolik,项目名称:git_workspace,代码行数:10,代码来源:simple.py

示例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)
开发者ID:tifoit,项目名称:knn-1,代码行数:10,代码来源:knn.py

示例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)
开发者ID:AbhijeetDixit,项目名称:MyAdventuresWithPython,代码行数:11,代码来源:GUI1.py

示例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])
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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)
开发者ID:spiderOO7,项目名称:my_python_codes,代码行数:12,代码来源:Quit_button.py

示例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)
开发者ID:FocusedOne,项目名称:eleventhirty,代码行数:13,代码来源:eleventhirty002.py

示例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)
开发者ID:Davidjohnwilson,项目名称:CADassistant,代码行数:13,代码来源:tkintertutorial.py

示例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()
开发者ID:timelinc0ln,项目名称:team07project3,代码行数:14,代码来源:CalReader2.py

示例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)
开发者ID:ktadimeti2,项目名称:whip,代码行数:14,代码来源:commence_whip.py

示例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)
开发者ID:ktadimeti2,项目名称:whip,代码行数:14,代码来源:commence_whip.py


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