Skip navigation.
 
mlRe: Source list with counter next to item title
FROM : Scott Anguish
DATE : Mon Nov 19 10:23:04 2007

On Nov 19, 2007, at 4:14 AM, GbT wrote:

> What's the best way to have a sourcelist with a counter next to the 
> title as
> you see in many apps (Mail and other indie apps)? I mean the grey
> circle-ellipse with the number of items written inside it.
> Maybe I need to subclass NSCell


Yes, You'd need to write your own subclass of NSCell to do this.

Have a look at the ClockControl and SimpleBrowser examples in /
Developer/Examples/AppKit

> and override the drawInteriorWithFrame:
> method, but how could I set the counter from, let's say, an 
> arraycontroller?
>
> Would it be possible using bindings?



You'd need to add bindings support to your subclass of NSCell.

I'm not sure that the on-disk version of ClockControl has this 
implemented.. you may want to check the web version at 
developer.apple.com to see if it is more current.

Related mailsAuthorDate
mlSource list with counter next to item title GbT Nov 19, 10:14
mlRe: Source list with counter next to item title Scott Anguish Nov 19, 10:23
mlRe: Source list with counter next to item title Scott Anguish Nov 19, 10:30
mlRe: Source list with counter next to item title GbT Nov 19, 10:42
mlRe: Source list with counter next to item title GbT Nov 19, 10:54
mlRe: Source list with counter next to item title Conor Nov 20, 12:15
mlRe: Source list with counter next to item title GbT Nov 20, 15:38
mlRe: Source list with counter next to item title Conor Nov 21, 10:57