Open muhammedjafer opened 3 weeks ago
def open_directory_dialog(self): self.file_path = filedialog.askdirectory(title="Select directory") if self.file_path != "": self.error_label.configure(text="") # Display shortened path with tooltip on hover self.set_directory_label() else: self.button.configure(text="Browse directory") self.error_label.configure(text="Directory is required") self.tooltip.hide() if self.tooltip else None def set_directory_label(self): if len(self.file_path) > 15: shortened_path = self.file_path[:15] + "..." self.button.configure(text=shortened_path) else: self.button.configure(text=self.file_path) self.tooltip = CTkToolTip(self.button, message=self.file_path, border_width=1, border_color=settings.get_arya_color())
i did a trick to fix it by using destroy method on the tooltip
self.tooltip.destroy()