Message50723
This patch improves two things I always found annoying
with Tkdnd.
First, it is not possible to change the default cursor
("hand2") that is used for drag and drop operations,
second, this cursor always shows up on <ButtonPress>
events and not on <Motion> events, as I think it should.
This has the ugly effect that if for example you use
Tkdnd to drag items from a Listbox, each time the user
selects a new item from the Listbox, the "hand2" cursor
pops up.
To fix the first issue I added a "dndcursor" option to
the dnd_start() function, which defaults to "hand2" to
keep the "classic" behavior intact.
Second I added a self.dndcursor attribute to the
DnDHandler class that stores this dndcursor's value;
then I moved the call that actually changes the
widget's cursor into the DnDHandler.on_motion() method
to make sure that this cursor only shows when actually
some drag occurs. self.dndcursor is set to None then,
to avoid multiple calls to "widget['cursor'] == ...". I
know that this is a slight change to the original
behavior, however I doubt that anyone will miss it.
Regards
Michael
|
|
Date |
User |
Action |
Args |
2007-08-23 15:53:39 | admin | link | issue1525806 messages |
2007-08-23 15:53:39 | admin | create | |
|