Re: 2 outline views, selection changes

2008-08-02 Thread Keary Suska
8/1/08 8:08 PM, also sprach [EMAIL PROTECTED]:

> I've been wracking my brain over this and after having too much
> caffeine and little results ...
> 
> I have 2 outline views and I'd like to have them operate such that
> selecting an item in OV#1, deselects any item(s) in OV#2 and vice versa.
> 
> I have tried many things in
> 
> - (void)outlineViewSelectionDidChange:(NSNotification *)notification
> 
> and in
> 
> - (void)outlineViewSelectionIsChanging:(NSNotification *)notification
> 
> however, when I try adjusting the selection in one view, it causes a
> loop where both end up having nothing selected.

Off the top of my head, and keeping your current approach, you can check for
a selection in the other OV before attempting to clear the selection of
itself. I.e.:

1. User clicks in OV#1
2. OV#2 delegate receives -outlineViewSelectionDidChange:; checks to see if
OV#1 has a selection, if so, clears OV#2's selection.
3. Clear action of OV#2 causes OV#1's delegate to receive
-outlineViewSelectionDidChange:; checks to see if OV#2 has a selection,
which it shouldn't since it has just been cleared, so does nothing.

This should be properly reversible (i.e. should work equally if you swap #2
for #1 in the above).

Alternatively, you could implement the "clear" operation in an action method
invoked by the OV (don't forget to check -clickedRow).

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


2 outline views, selection changes

2008-08-01 Thread Jack Carbaugh
I've been wracking my brain over this and after having too much  
caffeine and little results ...


I have 2 outline views and I'd like to have them operate such that  
selecting an item in OV#1, deselects any item(s) in OV#2 and vice versa.


I have tried many things in

- (void)outlineViewSelectionDidChange:(NSNotification *)notification

and in

- (void)outlineViewSelectionIsChanging:(NSNotification *)notification

however, when I try adjusting the selection in one view, it causes a  
loop where both end up having nothing selected.


I hope this makes sense.

Thanks for any advice.

Jack
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]