Article View: comp.sys.next.programmer
Article #1212Re: Drag&drop of colors in Views - how does -acceptColor: atPoint: work?
From: Scott Hess
Date: Tue, 18 Aug 1992 19:42
Date: Tue, 18 Aug 1992 19:42
39 lines
2493 bytes
2493 bytes
In article <1992Aug18.063238.3891@bosslogic.com> pclark@bosslogic.com (Pete Clark) writes: >In article <SCOTT.92Aug17092008@nic.gac.edu> writes: >> So, what's up? Am I just not doing something right? There's not >> much area to go wrong, here, and I've checked the spelling against >> the documentation about a billion times. It just doesn't seem to >> work. Anyone out there got an example of receiving colors for your >> View? > > This class works as expected under 3.0PR2. The instance of >MyView is a subview of a Box, which is in a Window. In order to hamstring the minor groundswell of response I've been receiving, I figure I'll post this on the net and let everyone in on The Real Dope. The method _does_ work, with qualifications. Apparently, if the receiving View is flipped, the test for whether the swatch is in the View is wrong, so you don't get the message when the drop is in the View - you get it when the drop is _above_ the View! [Didn't they use View's -mouse:inRect:?] In any case, there are a couple alternatives. An obvious and workable one is to do [myView setFlipped:NO]. I did that, and things work awesome. Another solution is the NextAnswers solution. It uses a +poseAs: on NXColorPanel which overrides +dragColor:withEvent:fromView: to do things the right way. I'm sure this works fine - it is a bit involved, though. Unflipping the View works much better with less fuss and muss, when applicable. [Some might ask "Why didn't scott check NextAnswers in the first place?" I did. My index was screwed up, though, so the search didn't turn up anything ...] Later, -- scott hess <shess@ssesco.com> <Who achieved programmer nirvana on Aug 11th> 12901 Upton Avenue South, #326 Burnsville, MN 55337 (612) 895-1208 Anytime! <Text: One Class to bring them all and in the darkness bind them ...>
Technical Details
Message-ID:
<SCOTT.92Aug18194208@nic.gac.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!noc.msc.net!gacvx2.gac.edu!gacvax2!scottReferences:
<SCOTT.92Aug17092008@nic.gac.edu> <1992Aug18.063238.3891@bosslogic.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!noc.msc.net!gacvx2.gac.edu!gacvax2!scott Newsgroups: comp.sys.next.programmer Subject: Re: Drag&drop of colors in Views - how does -acceptColor: atPoint: work? Message-ID: <SCOTT.92Aug18194208@nic.gac.edu> From: scott@nic.gac.edu (Scott Hess) Date: 18 Aug 92 19:42:08 References: <SCOTT.92Aug17092008@nic.gac.edu> <1992Aug18.063238.3891@bosslogic.com> Organization: Gustavus Adolphus College Nntp-Posting-Host: nic.gac.edu In-reply-to: pclark@bosslogic.com's message of Tue, 18 Aug 1992 06:32:38 GMTLines: 40 Lines: 40