-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
ตัวอย่าง tkinter แบบต่างๆ
from tkinter import *
root = Tk()
root.title("GUI Example by ajรติวัฒน์")
root.geometry("300x250")
root.option_add('*font', 'Comic Sans MS 14 bold italic')
root.mainloop() #windows GUI tkinter background #B63C95
from tkinter import *
root = Tk()
root.title("GUI Example by ajRatiwat")
root.geometry("400x350")
root.option_add('*font', 'Comic Sans MS 10 bold')
frame = Frame(root)
frame.config(background="#B63C95")
frame.place(width=400, height=350, x=0, y=0)
root.mainloop()
#windows GUI tkinter background #45B83F + button
#windows GUI tkinter background #45B83F + button
from tkinter import *
root = Tk()
root.title("GUI by ajRatiwat")
root.geometry("300x250")
root.option_add('*font', 'tahoma 16 bold')
frame = Frame(root)
frame.config(background="#45B83F")
frame.place(width=300, height=250, x=0, y=0)
button1 = Button(frame, text="ปุ่มที่1", width=12, height=2,foreground = "red")
button1.pack(padx=30, pady=30)
image1 = PhotoImage(file="./book.gif")
button2 = Button(frame, image=image1, text="กดปุ่มนี้", width="100", height=30, compound="left", bg="white", foreground="blue")
button2.pack(padx=30, pady=30)
root.mainloop()output
from tkinter import *
root = Tk()
root.title("GUI App ajratiwat-ex9-04")
root.geometry("300x250")
root.option_add('*font', 'Sarabun 10 bold')
frame = Frame(root)
frame.config(background="cyan")
frame.place(width=300, height=250, x=0, y=0)
photo=PhotoImage(file="./22.gif")
label1 = Label(frame, image=photo, text="Label1", width="80", height=60, compound="top", bg="white")
label1.grid(column=1, row=0, padx=15, pady=15)
label2 = Label(frame, text="Label2", width=10, anchor=W)
label2.grid(column=0, row=1, padx=15, pady=15)
message3 = Message(frame, text="How are you today? ฉันหลับสบายดี เพราะฝนตก บายๆๆๆๆ.", width=80, anchor=W, bg="yellow")
message3.grid(column=1, row=1, padx=15, pady=15)
root.mainloop()Metadata
Metadata
Assignees
Labels
No labels
