Created
February 14, 2016 16:03
-
-
Save lsongdev/2472ba14109e347facbd 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
from Tkinter import * | |
def fn(*args): | |
messagebox.showinfo(content.get()) | |
root = Tk() | |
root.title("Google") | |
main = Frame(root) | |
main.pack() | |
img = PhotoImage(file = 'google-logo.gif') | |
lbl = Label(main, text = "test") | |
lbl[ 'image' ] = img; | |
lbl.pack() | |
content = StringVar() | |
content.set("google") | |
txt = Entry(main, textvariable = content) | |
txt.pack() | |
btn = Button(main, text = "Hello World", command = fn) | |
# btn[ 'style' ] = 'NuclearReactor.TButton' | |
btn.pack() | |
btn.invoke() | |
# cmb = Tkinter.Combobox(main) | |
# cmb.pack() | |
items = StringVar(value = ( "a", "b" )) | |
lst = Listbox(main, listvariable = items) | |
lst.pack() | |
# bar = Progressbar(main) | |
# bar.pack() | |
scale = Scale(main, orient=HORIZONTAL) | |
scale.pack() | |
# book = Notebook(main) | |
# book.pack() | |
canvas = Canvas(main) | |
canvas.pack() | |
canvas.create_line(10, 10, 200, 50) | |
# tree = Treeview(main) | |
# tree.pack() | |
menu = Menu(root) | |
root.minsize(200,100) | |
root.geometry('500x500-300+300') | |
root.bind("<Return>", fn) | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment