หน้าต่างแอปพลิเคชัน Tkinter มีองค์ประกอบหลายอย่าง:ขนาดหน้าต่าง ชื่อ แถบนำทาง ส่วนประกอบแถบเมนู ฯลฯ ในการกำหนดค่าแอตทริบิวต์หรือคุณสมบัติของหน้าต่าง เราสามารถใช้ชุดเครื่องมือ Window Manager ที่กำหนดไว้ใน Tcl/Tk
หากต้องการเรียกใช้แอตทริบิวต์ Window Manager ให้ใช้คำสั่ง 'wm' พร้อมคีย์เวิร์ดอื่นๆ ชื่อของหน้าต่างสามารถกำหนดค่าได้โดยใช้ wm_title("title") หรือ title("title") วิธีการ
ตัวอย่าง
# Import the required libraries
from tkinter import *
# Create an instance of tkinter frame or window
win=Tk()
# Set the size of the window
win.geometry("700x350")
# Change the title of the window
win.wm_title("My Window")
Label(win, text="Hello, Welcome to Tutorialspoint...", font=('Calibri 24')).pack()
win.mainloop() ผลลัพธ์
หากเราเรียกใช้โค้ดข้างต้น จะแสดงหน้าต่างที่มีชื่อ "หน้าต่างของฉัน"
