Skip navigation.
 
mlRe: displaying image and multiple rows of text in NSTableView row
FROM : Corbin Dunn
DATE : Mon Mar 03 18:16:42 2008

On Mar 3, 2008, at 6:34 AM, Nick Rogers wrote:
> Hi,
> I'm using NSTableView for displaying.
> Now I need to show an icon in every row and also have to display 2 
> rows of text in one row of tableView.
> Is it possible, if yes then how and can i incresse a row's width to 
> accomodate two rows of text?


Two rows of text in a single row? Maybe you just want to use variable 
row heights. But then, that doesn't affect a row's width, which is 
always constant (it equals the width of the tableview).

Maybe you want to increase the columns width?

You can have a row span all columns with:

/*  Optional - Different cells for each row
    A different data cell can be returned for any particular 
tableColumn and row, or a cell that will be used for the entire row (a 
full width cell). The returned cell should properly implement 
copyWithZone:, since the cell may be copied by NSTableView. If the 
tableColumn is non-nil, you should return a cell, and generally you 
will want to default to returning the result from [tableColumn 
dataCellForRow:row].

    When each row is being drawn, this method will first be called 
with a nil tableColumn. At this time, you can return a cell that will 
be used to draw the entire row, acting like a group. If you do return 
a cell for the 'nil' tableColumn, be prepared to have the other 
corresponding datasource and delegate methods to be called with a 
'nil' tableColumn value. If don't return a cell, the method will be 
called once for each tableColumn in the tableView, as usual.
*/
- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:
(NSTableColumn *)tableColumn row:(NSInteger)row 
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

-corbin

>
> OR
> if not possible, then can i use NSOutlineView for this purpose and 
> how?
>

Related mailsAuthorDate
mldisplaying image and multiple rows of text in NSTableView row Nick Rogers Mar 3, 15:34
mlRe: displaying image and multiple rows of text in NSTableView row Corbin Dunn Mar 3, 18:16
mlRe: displaying image and multiple rows of text in NSTableView row Jens Alfke Mar 3, 23:02