Home Installation Release notes Language Reference Support Downloads Tutorials FutureBasic 5 Links

Working with nibs - TableView

1. Launch Xcode and create a new User Interface/Window
 

2. Set the window's minimum content size


 

3. Show the Objects panel and drag a tableview onto the window


 

4. Resize the enclosing scrollview to fit the window and set its autoresizing springs and struts to grow/shrink with the window


 

5. Set the tableview columns to '1'


 

6. Set the tableview tag value


 

7. Save and close the nib file
 

8. In FutureBasic, create a new file

void local fn CreateTableData
CFMutableArrayRef tableData = fn TableViewData(1)
MutableArrayAddObject( tableData, @"Alpha" )
MutableArrayAddObject( tableData, @"Bravo" )
MutableArrayAddObject( tableData, @"Cocoa" )
MutableArrayAddObject( tableData, @"Delta" )
MutableArrayAddObject( tableData, @"Echo" )
MutableArrayAddObject( tableData, @"FutureBasic" )
TableViewReloadData(1)
end fn

void local fn BuildWindow
nibwindow 1, @"Window"
fn CreateTableData
end fn

fn BuildWindow

HandleEvents

 

9. Save the FB file to the same folder as the nib and run it