This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author klappnase
Recipients
Date 2006-07-20.10:28:26
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2007-08-23 15:53:39adminlinkissue1525806 messages
2007-08-23 15:53:39admincreate