Skip navigation.
 
mlRe: Source list group item indentation
FROM : Corbin Dunn
DATE : Wed Jan 16 20:49:10 2008

>
>
> Subclass NSOutlineView, and override the following method:
>
> - (NSRect)frameOfOutlineCellAtRow:(NSInteger)row
> {
>     // Default to show triangle
>     BOOL showTriangle = YES;
>     
>     // See if delegate responds to new selector
>     if ([[self delegate] 
> respondsToSelector
> :@selector(outlineView:shouldShowDisclosureTriangleForItem:)])
>     {


Ah! One thing that I highly recommend changing is the selector 
signature. Let's say you call your class "CDOutlineView". I'd suggest 
using the selector name: 
cdOutlineView:shouldShowDisclosureTriangleForItem:.

If Apple introduces the same method name in a later version of the OS 
then it may conflict with yours, and it may start to be called at 
different times with different parameters. This type of thing does 
happen, and I'll give you an example. On Leopard we introduced:

- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:
(NSTableColumn *)tableColumn row:(NSInteger)row;

However, other people implemented the same thing in a custom subclass, 
and it caused compatibility problems. The solution was for people to 
be forced to link against Leopard in order to use the new delegate 
method, which is unfortunate (mainly because it doesn't allow people 
to sort of soft-adopt it in their 10.4 apps - if that doesn't make 
sense, don't worry).

corbin

Related mailsAuthorDate
mlSource list group item indentation Kyle Sluder Jan 11, 15:16
mlRe: Source list group item indentation Jean-Daniel Dupas Jan 11, 15:24
mlRe: Source list group item indentation Jonathan Dann Jan 11, 16:12
mlRe: Source list group item indentation Corbin Dunn Jan 16, 00:15
mlRe: Source list group item indentation Kyle Sluder Jan 16, 11:23
mlRe: Source list group item indentation Corbin Dunn Jan 16, 19:08
mlRe: Source list group item indentation Ben Jan 16, 19:55
mlRe: Source list group item indentation Corbin Dunn Jan 16, 20:49
mlRe: Source list group item indentation Hamish Allan Jan 16, 20:52
mlRe: Source list group item indentation Pete Callaway Jan 17, 09:34