SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] canvas objects

From: Paul K. <pki...@ni...> - 2007年07月06日 14:33:48
Hi,
I've been playing with the pick infrastructure in 0.90 and find that
it doesn't meet my needs. The issue is that events from all artists
go to the same callback, so you are forced write your callback as a
series of if statements for each artist which may receive a pick event.
I would rather have an infrastructure more like a canvas, where I
can register callbacks to particular handles for particular 
mouse events (enter, leave, motion, press and release). I would like
to rely on the zorder attribute of artists when processing the
events. If the callback succeeds, then the event is consumed and 
no more handles are checked. If the callback fails then the next
lower zorder handle is checked.
I can simulate what I want with the current infrastructure by having
the mouse events call figure.pick() and the pick event capture
every object that was picked, but it is ugly and not very 
efficient (not every object wants to track enter/motion/leave
events for example, but they get asked on every pick even if
they only want to monitor mouse clicks).
Instead I would like to start by splitting the current pick method
into two parts:
 contains(event,picker) which returns truth value,details
 pick(event) which generates the current pick event
Later I can construct the infrastructure I want on the contains()
function for each artist.
Does this approach seem reasonable to those who will approve the
patches I will send?
Thanks,
Paul Kienzle
pki...@ni...

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /