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

Working with nibs - TextView

1. Launch Xcode
 

2. Choose File > New > File… (⌘N)


 

3. At the top of the choose template sheet...
a) click "macOS"
b) under 'User Interface', select "Window"
c) click "Next" button


 

4. Click "Create" button to save the xib file as "Window"


 

5. Choose View > Libraries > Show Library (⇧⌘L)


 

6. In the search field, at the top of the objects panel, type "textview" and drag a 'Scrollable Text View' onto the window


 

7. With the scroll view still selected
a) drag its corners to fill the window
b) select the Size Inspector icon
c) in 'Autoresizing', click both horizontal and vertical arrows in the centre box to highlight them


 

8. Switch to the Attributes Inspector and click twice on the scrollable text view in the window to select the Text View


 

9. Scroll down to the 'View' area to set its Tag value... Eek! That field is disabled! Not to worry. We'll let CocoaUI know its tag value another way...


 

10. Click on the Identity Inspector icon and enter the text field's tag value in the 'Identifier' field


 

11. Save changes and close the nib file
 

12. In FutureBasic, create a new file and paste the following code

void local fn BuildWindow
nibwindow 1, @"Window"
TextSetString( 1, @"Resizable Text View" )
end fn

fn BuildWindow

HandleEvents
 

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