Friday, July 21, 2017

#1 2014-08-21 08:56:00 am

pab71
Member
Registered: 2014-02-04
Posts: 2

Tableview with different rows

Hi,

I'm hoping someone might be able to help me....

I'm trying to create a tableview that has different datasources on different rows, i.e one row has a popup cell, one may have a check box, another is a editable text field.

Does anybody out there have any examples of something similar???

Any help would be greatly appreciated.

Thanks

Offline

 

#2 2014-08-21 09:41:02 am

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2665
Website

Re: Tableview with different rows

pab71 wrote:

I'm trying to create a tableview that has different datasources on different rows, i.e one row has a popup cell, one may have a check box, another is a editable text field.


That is not possible in AppleScript-Studio. The type of cell is not defined by the table view but by the table column. That means each row has the same table cell. The table view doesn't use a copy for each cell displayed, for optimized performance and memory usage one table cell draws all table cells for that column.

Is it then completely impossible? No, you can subclass NSTableColumn where you can override the dataCellForRow: method with your own implementation drawing your own cell. Again, this cannot be done in AppleScript-Studio and must be done in Objective-C meaning it should be possible in AppleScriptObjC as well. As long as you don't draw the cell yourself but subclass an NSTableColumn that supports multiple standard cells, AppleScriptObjC could be worth a try.

Offline

 

#3 2014-08-21 09:43:21 am

pab71
Member
Registered: 2014-02-04
Posts: 2

Re: Tableview with different rows

Thanks for the reply. I'll take a look at AppleScriptObjC.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)