Ultra Light Client Guide and Reference

How can I open new ULC views?

The first view (at startup)
The class of the application's first view (let's call it MyStartUpView) is registered with the class UlcSystem (not the instance!) using the #registerApplicationNamed:withStartupClass: API, where the first parameter is a String that may be used as command-line parameter, the second one is MyStartUpView. This ensures that the registered class is given control as soon as the ULC environment is properly initialized. The new instance of MyStartUpView is opened in a (Smalltalk) process, whose owner is a fully initialized UlcApplication.

Additional views in running applications
Once the initial view is open, any additional view may be opened with this statement:
MyOtherViewClass new openWidget

The new widget will be opened in the currently active UlcApplication, which is well defined if the message was sent from a process started by ULC. This means that opening views from an existing view will result in the new views being created in the UlcApplication/UlcContext of the view from which they are opened. Under most circumstances the issue of what UlcApplication will hold a new view is of no concern for the application developer. If you are unsure whether the Smalltalk process is owned by your UlcApplication, send the #evaluate: aBlock message to the UlcApplication's processOwnerToken and open the new view inside aBlock.

Open a child view
If you want to open a new view as child of one already open use:
MyOtherViewClass new openWidget

Again, if unsure whether the Smalltalk process is owned by your application, proceed as described above.

Note:
If a view is opened based on UI input (i.e. a Button has been pushed, etc.), the process ownership is set to your UlcApplication by ULC. You do not need to set ownership explicitly. As a general rule of thumb, if the code opening a new view resides in a subclass of UlcAppBldrPart, chances are that you do not need to concern yourself with process ownership. If the code is in general non-ULC application code, you will need to be more careful.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]