j4321 / tkcalendar

Calendar widget for Tkinter
https://pypi.python.org/pypi/tkcalendar
GNU General Public License v3.0
97 stars 33 forks source link

can't change the cursor the dropdown arrow #95

Open arsalanshaikh13 opened 1 year ago

arsalanshaikh13 commented 1 year ago

currently if we change the cursor of the dateentry the whole the entry's cursor gets changed but in my solution we can keep the entry's cursor intact and just change the cursor of the drop down arrow using the following:

this is the function in the dateentry.py and my addition is just the **kwargs part

def _on_motion(self, event,**kwargs): """Set widget state depending on mouse position to mimic Combobox behavior.""" x, y = event.x, event.y if 'disabled' not in self.state(): if self.identify(x, y) == self._downarrow_name: self.state(['active']) ttk.Entry.configure(self, cursor=kwargs['cursor']) else: self.state(['!active']) ttk.Entry.configure(self, cursor=self._cursor) so we can use it like : date_entry = DateEntry(frame) date_entry.bind("",lambda event,cursor="hand2":date_entry._on_motion(event,cursor="hand2"))