[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Using SIOUX windows in your own application

This section explains how you can limit how much SIOUX controls your program. But first, you need to understand how SIOUX works with your program. You can consider the SIOUX environment to be an application that calls your main() function as just another function. Before SIOUX calls main(), it performs some initialization to set up the Macintosh Toolbox and its menu. After main() completes, SIOUX cleans up what it created. Even while main() is running, SIOUX sneaks in whenever it performs input or output, acting on any menu you've chosen or command key you've pressed.
However, SIOUX lets you choose how much work it does for you. You can choose to handle your own events, set up your own menus, and initialize the Macintosh Toolbox yourself.
When you want to write an application that handles its own events and uses SIOUX windows for easy input and output, set the field standalone to false before you use standard input or output. SIOUX doesn't use its event loop and sets the field autocloseonquite to true for you, so the application exits as soon as your program is done. In your event loop, you need to call the function SIOUXHandleOneEvent(), described on "Using SIOUX windows in your own application".
When you don't want to use SIOUX's menus, set the field setupmenus to false. If standalone is also false, you won't be able to create menus, and your program will have none. If standalone is true, you can create and handle your own menus.
When you want to initialize the Macintosh Toolbox yourself, set the field initializeTB to false. The field standalone does not affect initializeTB.
For example, these lines set up SIOUX for an application that handles its own events, creates its own menus, and initializes the Toolbox:
   SIOUXSettings.standalone = false;
   SIOUXSettings.setupmenus = false;
   SIOUXSettings.initializeTB = false;
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000