Created
June 18, 2015 15:00
-
-
Save wanghongfei/3a4c97c6dad859f772b9 to your computer and use it in GitHub Desktop.
提醒自己订餐,要不明天中午没的吃了
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'wanghongfei' | |
# -*- coding:utf8 -*- | |
import Tkinter | |
WIDTH = 300 | |
HEIGHT = 200 | |
# centralize window | |
def center_window(root, w, h): | |
# get screen width and height | |
ws = root.winfo_screenwidth() | |
hs = root.winfo_screenheight() | |
# calculate position x, y | |
x = (ws / 2) - (w / 2) | |
y = (hs / 2) - (h / 2) | |
root.geometry('%dx%d+%d+%d' % (w, h, x, y)) | |
# create window | |
window = Tkinter.Tk() | |
window.title('赶紧订饭!!!!') | |
center_window(window) | |
label = Tkinter.Label(window, text="要不明天就饿肚子!!", bg="red", font=("Arial", 12), width=WIDTH, height=HEIGHT) | |
label.pack(side=Tkinter.LEFT) | |
window.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment