Skip navigation.
 
mlRe: NSView and array of moveable NSImages
FROM : Scott Anguish
DATE : Thu Apr 05 22:10:34 2007

I sent that too soon.

Yes, this is how I did it when I was doing drawing applications for a 
living.

Actually, I used a double linked list, since this made it easy to 
traverse into groups, and move items around wholesale.  But this was 
a large, large scale package that often had 50,000 items to deal with.

But an array would work just as well on smaller systems.

On Apr 5, 2007, at 4:01 PM, I. Savant wrote:

> On 4/5/07, Scott Anguish <<email_removed>> wrote:

>>
>> There isn't much extensive to it.  You simply start at the closest
>> rectangle and test the bounds against the mouse location.  First hit
>> is the one that you drag.
>>

>
>  So you're saying the z-order should be managed by the image's
> position in the array (index zero being the topmost image)? If so,
> that's even better than maintaining a "z-order" property. :-) Just
> move the images around in the array to change the z-order.
>
>  (sigh) No matter how efficient you think you've made something,
> someone always comes along and points out a way you can make it even
> more so. :-}
>
> --
> I.S.

Related mailsAuthorDate
mlNSView and array of moveable NSImages Fen Soares Apr 5, 21:01
mlRe: NSView and array of moveable NSImages Scott Anguish Apr 5, 21:49
mlRe: NSView and array of moveable NSImages I. Savant Apr 5, 22:01
mlRe: NSView and array of moveable NSImages Scott Anguish Apr 5, 22:07
mlRe: NSView and array of moveable NSImages Scott Anguish Apr 5, 22:10
mlRe: NSView and array of moveable NSImages Michael Watson Apr 5, 22:13
mlRe: NSView and array of moveable NSImages Michael Watson Apr 5, 22:14
mlRe: NSView and array of moveable NSImages I. Savant Apr 5, 22:16
mlRe: NSView and array of moveable NSImages Fen Soares Apr 6, 10:10