unwanted cell copy being interposed during click in outline
unwanted cell copy being interposed during click in outline
- Subject: unwanted cell copy being interposed during click in outline
- From: Matt Neuburg <email@hidden>
- Date: Thu, 19 Oct 2006 20:48:07 -0700
- Thread-topic: unwanted cell copy being interposed during click in outline
In an NSOutlineView, my custom NSCell subclass has several icons in it, and
when the user clicks on one of these I want to change it (i.e. it's a kind
of custom checkbox).
However, there's a problem. As the user clicks, before I get an event, Cocoa
copies the cell and interposes the copy. Then Cocoa draws the cell; then
when the user releases the mouse, Cocoa substitutes the original cell and
draws again.
So, all during mouse tracking - which is when I decide whether the user has
clicked on an icon - there is this substitute copy in the way. However, that
is the moment when I'm saying, aha, the user has clicked, so change the icon
image. Great, but I'm changing the icon image in a copy! The user releases
the mouse, and the original cell returns, with the icon unchanged.
How am I supposed to handle this situation? Remember, the copy is made
BEFORE the mouse starts tracking, and the original is returned AFTER the
mouse starts tracking, so information that I store in the cell's ivars
during tracking about how it should draw itself gets lost when the original
cell returns. Thx - m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden