You are on page 1of 1

import tkinter as tk

from tkinter import messagebox

def show_text():
print(input_box.get())
subtitle.config(text=input_box.get())
def tored ():
subtitle.config(fg="red")
def toblue ():
subtitle.config(fg="blue")

main_window = tk.Tk()
main_window.geometry("300x600")

title = tk.Label(main_window, text="Color Editor", fg="blue", font=("Arial", 15))


title.pack(pady=10)

# Create a frame to hold the entry widget and the "Place Text" button
frame = tk.Frame(main_window)
frame.pack(pady=20)

subtitle = tk.Label(frame, text="Placeholder", fg="black", font=("Arial", 19))


subtitle.pack(pady=10)

ini = tk.Label(frame, text="Input", fg="grey", font=("Arial", 15))


ini.pack(pady=5)

input_box = tk.Entry(frame, width=10, show="*")


input_box.pack(pady=10)

place_text = tk.Button(frame, text="Place Text", fg="black", bg="red", command=show_text)


Red = tk.Button(frame, text="red", fg="red", bg="black", command=tored)
Blue = tk.Button(frame, text="bLUE", fg="blue", bg="red", command=toblue)

place_text.pack()
Red.pack()
Blue.pack()

main_window.mainloop()

You might also like