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


Python Tk.geometry方法代码示例

本文整理汇总了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():
    resolution = load_resolution()
    root = Tk()
    root.geometry(resolution)
    root.wm_title('PiMenu')
    if len(sys.argv) > 1 and sys.argv[1] == 'fs':
        root.wm_attributes('-fullscreen', True)
    app = PiMenu(root)
    root.mainloop()
开发者ID:derphilipp,项目名称:pimenu,代码行数:11,代码来源:pimenu.py

示例2: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():

    root = Tk()
    root.geometry("320x350+300+300")
    root.resizable(0,0)
    app = MainWindow(root)
    root.mainloop()
开发者ID:sopoforic,项目名称:cgrr-mariospicross,代码行数:9,代码来源:marios_picross_puzzle_editor_gui.py

示例3: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():

    root = Tk()
    root.geometry("{}x{}+{}+{}".format(700, 500, 300, 300))
    app = Window(root)
    root.lift()
    root.mainloop()
开发者ID:neale,项目名称:audio_filtering,代码行数:9,代码来源:window.py

示例4: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():
  
    root = Tk()
    #The geometry() method sets a size for the window and positions it on the screen. The first two parameters are the width and height of the window. The last two parameters are x and y screen coordinates.
    root.geometry("250x150+300+300")
    app = Example(root)
    root.mainloop()  
开发者ID:terasakisatoshi,项目名称:PythonCode,代码行数:9,代码来源:tutorial.py

示例5: __init__

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
class FileChooser:
    def __init__(self):
        self.filechooser = Tk()
        self.filechooser.geometry('500x500+0+0')
        self.button  = Button(self.filechooser,text="Add Directory",command=self.addDir)
        self.listview = Listbox(self.filechooser)
        self.closebutton = Button(self.filechooser,text="Scan",command=self.Done)
        self.listview.pack(fill="both")
        self.button.pack(fill='x')
        helptext = """Select directories by pressing the "Add Directory" Button, then press Scan.
                        \n When the file tree appears, red text means the file or folder is a duplicate.
                        \n purple means the folder contains duplicates but itself is not a duplicate.
                        \n Double Click on red text entries to view matches"""
        self.instructions = Label(self.filechooser, text=helptext)
        self.instructions.pack(fill='both')
        self.closebutton.pack()


        self.filechooser.mainloop()
    def Done(self):
        self.filechooser.destroy()
    def addDir(self):
        dir = askdirectory()
        if os.path.isdir(dir):
            dirlist.append(dir)
            self.listview.insert('end',str(dir))
开发者ID:bretttjohnson1,项目名称:Duplicate_Discoverer,代码行数:28,代码来源:main.py

示例6: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():

    root = Tk()
    root.geometry("1100x450+300+300")
    root.resizable(width=False,height=False)
    app = Window(root)
    root.mainloop()
开发者ID:arran-dengate,项目名称:light-pollution,代码行数:9,代码来源:controller.py

示例7: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():

    root = Tk()
    root.geometry("1400x680+300+300")
    root.minsize(1400, 350)
    app = windowFrame(root)
    root.mainloop()
开发者ID:RagingRoosevelt,项目名称:RecipeManagerV2,代码行数:9,代码来源:gui.py

示例8: _calltip_window

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def _calltip_window(parent):  # htest #
    import re
    from tkinter import Tk, Text, LEFT, BOTH

    root = Tk()
    root.title("Test calltips")
    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
    root.geometry("+%d+%d"%(x, y + 150))

    class MyEditWin: # conceptually an editor_window
        def __init__(self):
            text = self.text = Text(root)
            text.pack(side=LEFT, fill=BOTH, expand=1)
            text.insert("insert", "string.split")
            root.update()
            self.calltip = CallTip(text)

            text.event_add("<<calltip-show>>", "(")
            text.event_add("<<calltip-hide>>", ")")
            text.bind("<<calltip-show>>", self.calltip_show)
            text.bind("<<calltip-hide>>", self.calltip_hide)

            text.focus_set()
            root.mainloop()

        def calltip_show(self, event):
            self.calltip.showtip("Hello world", "insert", "end")

        def calltip_hide(self, event):
            self.calltip.hidetip()

    MyEditWin()
开发者ID:5outh,项目名称:Databases-Fall2014,代码行数:34,代码来源:CallTipWindow.py

示例9: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():
    q = Queue()

    root = Tk()
    root.geometry("400x350+300+300")
    Example(root, q)
    root.mainloop()
开发者ID:chengyi818,项目名称:kata,代码行数:9,代码来源:1_calculating_pi.py

示例10: SelectDataFiles

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def SelectDataFiles():
    """Select the files to compress into a JAM"""
    # Draw (then withdraw) the root Tk window
    logging.info("Drawing root Tk window")
    root = Tk()
    logging.info("Withdrawing root Tk window")
    root.withdraw()

    # Overwrite root display settings
    logging.info("Overwrite root settings to basically hide it")
    root.overrideredirect(True)
    root.geometry('0x0+0+0')

    # Show window again, lift it so it can recieve the focus
    # Otherwise, it is behind the console window
    root.deiconify()
    root.lift()
    root.focus_force()

    # The files to be compressed
    jam_files = filedialog.askdirectory(
        parent=root,
        title="Where are the extracted LEGO.JAM files located?"
    )

    if not jam_files:
        root.destroy()
        colors.text("\nCould not find a JAM archive to compress!",
                    color.FG_LIGHT_RED)
        main()

    # Compress the JAM
    root.destroy()
    BuildJAM(jam_files)
开发者ID:le717,项目名称:PatchIt,代码行数:36,代码来源:legojam.py

示例11: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():
    window = Tk()
    window.geometry('1366x768')
    window.attributes('-fullscreen', True)
    window.wm_title('GUIDO')
    gui = GUI(window)
    window.mainloop()
开发者ID:xistingsherman,项目名称:SPTOR,代码行数:9,代码来源:Main.py

示例12: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():
    root = Tk(className="My graphics!")
    root.geometry("400x400")
    canvas = Canvas()
    canvas.pack(fill=BOTH, expand=1)
    # img = draw_gradient(canvas)

    img = draw_danger_levels(canvas, 50, 50)

    # что бы ограничить число
    # if n > 255:
    #     n = 255

    # хочу: n = 256 => 0
    # n = 257 => 1
    # ...
    # n = 300 => 44
    # 10 // 3 = 3(1)
    # 10 - (10 // 3) * 3
    # 10 % 3
    # a % b < b
    # 10 % 3 = 1
    # 11 % 3 = 2
    # 12 % 3 = 0
    # 13 % 3 = 1

    root.mainloop()
开发者ID:AndrewLvov,项目名称:DrawTkinter,代码行数:29,代码来源:main.py

示例13: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():
    print("Running...")
    root = Tk()
    root.geometry("250x150+300+300")
    app = Example(root)
    root.mainloop()
    print("Ran.")
开发者ID:merriam,项目名称:pyUI,代码行数:9,代码来源:tk_tut1.py

示例14: test

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def test():
    """
    Kolorem czarnym są narysowane obiekty utworzone
    za pomocą klas fabrycznych.
    Kolorem czerwonym obiekty utworzone przy użyciu
    funkcji shapeFactory
    """
    creator = RectangleCreator()
    rect = creator.factory("Rectangle",a=40,b=60)
    rect2 = shapeFactory("Rectangle",a=40,b=60, outline="#f00")
    creator = TriangleCreator()
    tri = creator.factory("Triangle",a=100,b=100,c=100)
    tri2 = shapeFactory("Triangle",a=100,b=100,c=100,outline="#f00")
    creator = SquareCreator()
    sq = creator.factory("Square",a=60)
    sq2 = shapeFactory("Square",a=60,outline="#f00")
    root = Tk()
    w = Window(root)
    w.drawShape(rect,100,100)
    w.drawShape(rect2,100,200)
    w.drawShape(tri,200,100)
    w.drawShape(tri2,200,200)
    w.drawShape(sq,370,100)
    w.drawShape(sq2,370,200)
    root.geometry("600x400+100+100")
    root.mainloop()
开发者ID:kpiszczek,项目名称:wzorceuj,代码行数:28,代码来源:cw2a.py

示例15: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import geometry [as 别名]
def main():

    root = Tk()
    root.geometry("927x550+50+50")
    root.resizable(width=False, height=False)
    app = Example(root)
    root.mainloop()
开发者ID:Ealdor,项目名称:EQGuildViewer,代码行数:9,代码来源:GuildViewer.py


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