Mike2012
Mike2012

Reputation: 7725

Minimum steps to display a table-view in Cocoa OSX

Hi I am trying to create a table-view programatically using a cocoa lisp bridge called clozure CL. Now I doubt many people are familiar with this package so I will not go into specifics of my code but I am getting some very strange errors when I try to call addSubview to add my tableView to my window. I have initialized it using InitWithFrame. I am wondering what are the minimum the steps required to programatically setup and add a tableView to a window. I cannot use the interface builder.

Any links to code that shows how to this in objective c would be very helpful I can do the conversions to lisp.

Upvotes: 1

Views: 2581

Answers (2)

Svante
Svante

Reputation: 51501

Here is a recently published Cocoa/Clozure Common Lisp tutorial:

http://tclispers.org/news/cocoalisp-tutorial

Don't be afraid to show Lisp code; I know that there are several regular Lispers here.

Upvotes: 2

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

1 - Create a scroll view (because the table's size will vary).

2 - Create the table view.

3 - Create columns (set their titles, data cells and identifiers if you're using data source protocol).

4 - Add the columns to the table.

5 - Bind the columns to an appropriate controller (if using bindings) or set the table's -dataSource to a controller that implements NSTableDataSource protocol (if using NSTableDataSource protocol).

6 - Add the scroll view to the appropriate superview with appropriate autoresize settings.

I'm sure I'm missing some configuration steps, but this is basically what you need.

Upvotes: 3

Related Questions