Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- from tkinter import ttk
- class Salman:
- def __init__(self):
- self.mainwin = tk.Tk()
- self.label = ttk.Label(self.mainwin, text="simple practice", font="italic")
- self.label.grid(row=0, column=0)
- self.button = ttk.Button(self.mainwin, text="button", command=self.clickme)
- self.button.grid(row=1, column=3)
- self.textvar = tk.StringVar()
- self.entry = ttk.Entry(self.mainwin, width=12, textvariable=self.textvar)
- self.entry.grid(row=1, column=2)
- tk.mainloop()
- def clickme(self):
- self.label.configure(text=self.textvar.get())
- self.button.config(text="ihave been clicked")
- style = ttk.Style()
- style.configure("TButton", foreground="blue")
- style.configure("TLabel", background="yellow")
- nomi = Salman()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement