This example assumes that you have made the application DevelopScreenCapture. (See Example: Using TrailBlazer to create DevelopScreenCapture.) Because DevelopScreenCapture contains a method that uses a platform-specific class, the instructions for making DevelopScreenCapture show how to define classes for both OS/2 and Windows, namely ScreenPMCapture and ScreenWinCapture. The catch to this arrangement is that you have to ensure that you use the correct class for your system.
You can ensure that you use the correct class by defining an OS/2 lineup
for OS/2 classes in DevelopScreenCapture and, similarly, a Windows
lineup for the Windows classes. For this example, the lineups contain
the following components:
Application DevelopScreenCapture
Class DevelopScreenCapture
Subapplication DevelopCapturePM (uses expression testing for OS/2)
Class DevelopCapturePM
Class ScreenPMCapture
Method saveGraphicImage (uses CgPMBMPFileFormat)
. <all other methods remain the same>
.
Subapplication DevelopCaptureWin (uses expression testing for Windows)
Class DevelopCaptureWin
Class ScreenWinCapture
Method saveGraphicImage (uses CgWinBMPFileFormat)
. <all other methods remain the same>
.
To define the lineups, begin by creating two subapplications: one for OS/2 and one for Windows.
Repeat the above steps, except for step 4 name the subapplication DevelopCaptureWin.
Next, complete the subapplications by moving and then releasing the appropriate classes to each. If you did not define both ScreenPMCapture and ScreenWinCapture when you completed Example: Defining the classes ScreenPMCapture and ScreenWinCapture, do so now.
To move ScreenPMCapture to the subapplication DevelopCapturePM:
Repeat the above steps for the subapplication DevelopCaptureWin, except move the class ScreenWinCapture to DevelopCaptureWin.
To ensure that the classes load with the appropriate subapplication, for each subapplication:
At this point, the Application Manager resembles the following when you
select DevelopScreenCapture:
Now that you have subapplications for each platform, assign to each subapplication a Smalltalk expression that evaluates to true only when a system is using the appropriate platform:
System vmType = 'ES' and: [(System subsystemType: 'CW') = 'PM']
Repeat the above steps, except for step 4 enter the following expression for the Windows lineup:
System vmType = 'ES' and: [#('WIN32s' 'WIN-NT') includes: (System subsystemType: 'CW')]
Next, delete the expression true:
Now that you have expressions for the lineups, test them by displaying them in a Workspace. It is essential that only one lineup expression return true. All other expressions must return false.
The following graphic shows that, on an OS/2 system, the Windows expression
displays false and the OS/2 system displays true.
This indicates that the expressions should work as desired and use only subapplication DevelopCapturePM if the platform is OS/2.
Note that when you added the lineups, the prerequisite DevelopmentWidget and its released edition name "disappeared" from the middle and lower right panes. For the subapplications to load successfully, you need to reinstate DevelopmentWidget as the prerequisite:
The prerequisite name is shown in the browser.
Repeat the above steps, except for step 1 select the other lineup expression.
Next, complete steps that are similar to the steps for releasing prerequisites. However, this time release the subapplications to DevelopScreenCapture:
Repeat the above steps, except for step 2 select the other lineup expression. And for step 4, select DevelopCaptureWin.
At this point, with the subapplication expression for Windows selected, the
Application Editions browser resembles the following:
The lineups for OS/2 and Windows should now be functional. To test them, try loading DevelopScreenCapture:
Loading from an Application Editions browser enables changes that you have made to the configuration for DevelopScreenCapture, which is in the library, to take effect in your image. You can check in an Application Manager to see if these changes took place. If DevelopScreenCapture loads successfully, its subapplications should be displayed without a > beside them. A > denotes that the subapplication has not been released to its containing application. Thus, if the load was successful, both DevelopCapturePM and DevelopCaptureWin should not have the >.
If the load was not successful, check any messages displayed in the Transcript. Also, examine the lineups in an Application Editions browser to ensure that the expressions are correct and that the appropriate prerequisites and subapplications are released to the lineups. Make any needed changes, then try to load again.
Finally, try loading DevelopScreenCapture from a system running
on the other platform.
![]() | As with the other example applications in this guide, you can open an
instance of ScreenPMCapture or ScreenWinCapture using
DevelopChooser. (See Making your own applications.) However, because the classes
ScreenPMCapture and ScreenWinCapture are
platform-specific, DevelopChooser needs to open an instance of the
correct class for the platform being used.
To change DevelopChooser so it opens an instance of ScreenPMCapture on an OS/2 system and an instance of ScreenWinCapture on a Windows system, repeat the above steps to define OS/2 and Windows lineups for DevelopChooser. For the OS/2 lineup, have the method addApplicationsToList open ScreenPMCapture. For the Windows lineup, have the method open ScreenWinCapture. |
To release a subapplication edition or version into many lineups of an application, when the application already contains the subapplication, do the following:
To view a list of subapplications, select the Application Names push button. A list of subapplications in the library is displayed (upper left pane).