import tkinter as tk
def perform_search():
query = entry.get()
# Perform search with the query (replace this with your actual search functionality)
result_label.config(text=f"Search Results for: {query}")
# Create the main window
root = tk.Tk()
root.title("Search Bar")
# Create and place the entry widget
entry = tk.Entry(root, width=30)
entry.pack(pady=10)
# Create and place the search button
search_button = tk.Button(root, text="Search", command=perform_search)
search_button.pack()
import tkinter as tk
def perform_search():
query = entry.get()
# Perform search with the query (replace this with your actual search functionality)
result_label.config(text=f"Search Results for: {query}")
# Create the main window
root = tk.Tk()
root.title("Search Bar")
# Create and place the entry widget
entry = tk.Entry(root, width=30)
entry.pack(pady=10)
# Create and place the search button
search_button = tk.Button(root, text="Search", command=perform_search)
search_button.pack()
# Create and place a label for displaying search results
result_label = tk.Label(root, text="")
result_label.pack(pady=10)
# Run the Tkinter event loop
root.mainloop()
# Create and place a label for displaying search results
result_label = tk.Label(root, text="")
result_label.pack(pady=10)
# Run the Tkinter event loop
root.mainloop()
No comments:
Post a Comment