Home Installation Release notes LanguageReference Support Downloads Tutorials FutureBasic 5 Links

Working with nibs - MainMenu

1. Launch Xcode and create a new User Interface/Main Menu


 

2. A default main menu will be created


 

3. Before going any further, change these item titles to the name of your app


 

4. Delete any unwanted menus and items (click on the menu or item and hit the delete key)
 

5. Edit the titles of existing menus and items (double-click)
 

6. To add a new menu, show the Objects panel and drag a 'Submenu Menu Item' to the menu bar


 

7. Double-click the new menu to edit its title


 

8. Add menu items and double-click to edit their titles


 

9. Save and close the nib file
 

10. In FutureBasic, create a new file

include "NSLog.incl"

void local fn BuildMainMenu
nibmenu @"MainMenu"
end fn

void local fn DoMenu( menuID as long, itemID as long )
NSLog(@"menuID: %ld, itemID: %ld",menuID,itemID)
end fn

fn BuildMainMenu

on menu fn DoMenu

HandleEvents

 

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