Akascape / CTkToolTip

Small pop-up widget for displaying details inside customtkinter. (extension/add-on)
Creative Commons Zero v1.0 Universal
111 stars 7 forks source link

CTkToolTip not compatible with CTkMenuBar ?? #26

Closed matthew-efseaff closed 3 months ago

matthew-efseaff commented 3 months ago

I tried to add a tooltip to a menu selection:

from CTkMenuBar import *
from CTkToolTip import *
self.menu_bar = CTkMenuBar(self.root)
self.menu_bar = self.menu_bar.add_cascade(text='some option')
self.drop_menu = CustomDropdownMenu(widget=self.menu_bar)
self.drop_menu.add_option(option='some option', command=lambda: self.some_command())
self.drop_menu_tip = CTkToolTip(self.drop_menu, delay=0.1, message="some tooltip")

It's not showing up... is this possible in CTkToolTip?

Akascape commented 3 months ago

Where do you expect the tooltip to popup? Inside the dropdown menu or the button which opens it?

matthew-efseaff commented 3 months ago

Either works. I'd actually like to have just a button in the menu bar (have a button instead of have to .add_cascade), but didn't think that was possible.... As an example, possibly place the tooltip here, in the dropdown: image

Akascape commented 3 months ago

The add_option method returns a button which is placed inside the dropdown, so pass that button to the tooltip.

self.option_1 = self.drop_menu.add_option(option='some option', command=lambda: self.some_command())
self.drop_menu_tip = CTkToolTip(self.option_1, delay=0.1, message="some tooltip")