hi it’s my first time asking and excuse my english
i trying to do a search frame but when i add the button i thin goes under the frame of the search it appears and then disppears fast i the search entry when i run the code appears and when run it a second time it disppears the output
i’m trying to do a simple orginazation desktop app any advice would be very helpful
from tkinter import ttk
from tkinter import *
from tkinter import messagebox
from PIL import Image, ImageTk
from datetime import datetime
import os, sys, shutil
from tkcalendar import Calendar, DateEntry
from threading import Thread
import time as t
class WidgetsApp:
def __init__(self, master):
self.master = master
self.master.geometry("1200x900+350+40")
self.master.resizable(width=False, height=False)
self.master.title("نظام أدارة تجمع العلماء")
self.call_fuction_add_title_frame = Thread(target=self.add_frame_title, args=())
self.call_fuction_add_title_frame.start()
self.call_add_search_frame = Thread(target=self.add_search_frame, args=())
self.call_add_search_frame.start()
self.call_search_person = Thread(target=self.add_entry_search, args=())
self.call_search_person.start()
self.call_button_search = Thread(target=self.get_search,args=())
self.call_button_search.start()
def add_frame_title(self):
self.title_frame = Frame(
self.master,
width=1175,
height=80,
background="#E8E4FA",
)
self.title_frame.place(x=18, y=4)
self.title_label = Label(
self.title_frame,
width=30,
height=1,
background="#E8E4FA",
font=("Libre Baskerville, serif;", 26),
text="أضافة عالم",
)
self.title_label.place(x=300, y=20)
def add_search_frame(self):
self.search_frame = Frame(
self.master,
width=1165,
height=80,
background="#d9ddf7",
relief="solid",
border=2,
)
self.search_frame.place(x=18, y=88)
self.search_label = Label(
self.master,
background="#d9ddf7",
text="أبحث عن أسم",
font=("Bold Oblique", 18),
)
self.search_label.place(x=1060, y=113)
def add_entry_search(self):
self.search_person = Entry(
self.master,
width=20,
background="powder blue",
font=("Bold Oblique", 18),
relief=RIDGE,
border=1,
)
self.search_person.place(x=200, y=113)
def get_search(self):
self.image_search = Image.open("images\user-avatar.png")
self.image_search = self.image_search.resize((35, 35))
self.show_image_search = ImageTk.PhotoImage(self.image_search)
self.button_search = Button(
self.master,
width=90,
height=30,
text="أبحث",
font=("Bold Oblique", 18),
padx=20,
relief=FLAT,
bd=1,
compound='left',
image=self.show_image_search
)
self.button_search.place(x=40,y=106)
New contributor
mohammed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.