LaunchPad Revisited

From EDM2
Jump to: navigation, search

By Richard K. Goran

When I began to plan this column, I thought it would be one of the easiest that I have done for OS/2 Magazine since I had covered the subject of creating your own LaunchPad exactly 12 issues ago (OS/2 Magazine, June 1995). My reason for devoting another column to LaunchPad creation and manipulation is quite simple, I still receive E-mail asking questions based on that original column. Also, more has become known about the WPLaunchPad object and I wanted to include this new information along with a technique to eliminate the old LaunchPad objects which accumulate in your system every time you create a new LaunchPad, either via REXX or drag and drop. In actuality, I spent more time than anticipated in preparing the material for the column because I bumped into some Workplace Shell bugs. It turns out that these have been reported in APARS (IBM-speak for authorized program analysis report) but I didn't know this when I started. These APARS (PJ16250, PJ17466, PJ17788, PJ18286, PJ19937) all deal with Workplace Shell hangs when manipulating objects that contain the NOTVISIBLE=YES property.

To read a full explanation of the characteristics of the LaunchPad, simply RMB (right mouse button click) on the border of your LaunchPad which surrounds the faceplate objects or the drawer buttons and select Help. The faceplate objects are the pushbuttons you see covering the LaunchPad and the drawers are the pushbuttons you see when you open the faceplate subordinate objects by clicking on the button containing an arrow which is adjacent to each faceplate object. There will not be any arrow associated with a faceplate object if there are no drawer objects associated with the faceplate.

It is important to note that each object in the LaunchPad is a shadow of some other object. To add an object to the LaunchPad, simply RMB drag any object and drop it on either the LaunchPad itself or on one of its drawers. When you want to drop an object between two other objects on the LaunchPad face plate (the LaunchPad icons that are not in the drawers), a black bar will appear between the two positions when it is alright to release the RMB. Similarly, adding an object to a drawer is accomplished by dragging an object to the position on the drawer where you want the new object to appear and dropping it when the black bar is in the proper position. Since LaunchPad objects are, by definition, shadows its is unnecessary to hold <Ctrl-Shift> when dragging an object to the LaunchPad as you would do if you were creating a shadow elsewhere.

You can create any number of LaunchPads via REXX using setup strings to define each LaunchPad's characteristics, faceplate objects, and any drawers attached to each faceplate object. LaunchPad objects belong to the WPLaunchPad class. The default LaunchPad object has an object ID of <WP_LAUNCHPAD> and shadows of the objects on the LaunchPad normally reside in the \Nowhere1 directory on your OS/2 boot drive. I have seen systems where the \Nowhere1 directory has been deleted. In that case, the LaunchPad shadows will be found in the \Nowhere directory. Since these shadows are abstract rather than file system objects, you can't simply use a DIR command to see what is there. It is necessary to open the abstract object using the SysOpenObject() function contained in the REXXUTIL API (Application Program Interface). The easiest way to do this is to launch REXXTRY from an OS/2 command line and invoke the SysOpenObject() function with:

say SysOpenObject( '?:\Nowhere1', 1, 1 )

(where ? represents your boot drive). The SysOpenObject() function was introduced with OS/2 Warp. If you are running a prior version of OS/2, you can use the SysSetObjectData() function to open the directory. For example:

say SysSetObjectData( '?:\Nowhere1', 'OPEN=DEFAULT;' )

will open the icon view of the directory.

If the default LaunchPad is deleted, either intentionally or accidentally, it can be recreated simply by double clicking anywhere on the Desktop. [#Figure 1 Figure 1] shows the layout of the default LaunchPad and [#Fragment 2 Fragment 2] shows the settings that are used to create this default LaunchPad. If you want to create more than one LaunchPad, each must have a unique object ID, one of which should be the default of <WP_LAUNCHPAD>.

There are a few items that my previous LaunchPad column did not address that are significant. Also, I have created a new program which is available via anonymous FTP, [9606ls01.cmd], that addresses these issues. [#Figure 3|Figure 3] shows the LaunchPad that was created using 9606ls01.cmd on one of my systems. You can easily modify this program to contain your own faceplate and drawer objects to build a customized LaunchPad. Each faceplate and drawer group is defined so that only the object names (either object ID or full file system name) need be changed. [#Fragment 4|Fragment 4] shows the lines used to create a faceplate with an OS/2 windowed session and drawers containing an OS/2 full screen session, DOS windowed and full screen sessions, and WIN-OS2 windowed and full screen sessions.

"Garbage collection" is a concern when recreating any LaunchPad. When a new LaunchPad is created, all of the old shadows remain in the \Nowhere1 directory until they are explicitly deleted. If you have had occasion to recreate your LaunchPad, either the default configuration or a customized version, you have a lot of dead shadows in your \Nowhere1 directory. You can see these unused shadows by opening \Nowhere1 as I showed above. There is no way to determine which of these shadows are active and which can be removed. If you inadvertently delete an active shadow, the corresponding object will disappear from your LaunchPad. The WPTools API provides the WPToolsFolderContent() function that will allow you to enumerate the contents of a folder object or directory. Each of these objects can be checked to see if it is a shadow and, if so, you can delete it. I am not aware of any other OS/2 application that creates shadows in this directory so no harm should come from deleting all of the shadows you find. If you find objects that are not shadows they should be left alone. One program that I know of that creates objects in \Nowhere1 is DeskMan/2 from Development Technologies.

You will also find numerous objects with a title of Find in the icon view of \Nowhere1. These are WPFilter objects created by the OS/2 Find facility. Unfortunately, WPTools does not include these in the list of objects it returns so these dead objects have to be manually dragged to your Shredder to eliminate them.

If the \Nowhere1 directory is deleted, you will lose your .inf file association to the view.exe program. This results from the loss of one of OS/2's mystery objects, <WP_VIEWINF>. The <WP_VIEWINF> object is built by OS/2 Install to associate .inf files with the VIEW program. I can't understand why this technique was used since it would have been easier simply to create an association for view.exe specifying *.inf as the file association. Be that as it may, since <WP_VIEWINF> is built with NOTVISIBLE=YES, changing it can result in the problems described in the APARS I listed at the beginning of this column.

Another problem occurs when trying to add additional faceplate objects to an existing LaunchPad (PJ17466). If you want to add an additional faceplate with a REXX program, it is necessary to recreate the LaunchPad, creating the faceplates first and then adding the drawer objects.

Resources

  • [9606ls01.zip] (free for download - includes WPTools DLL)
  • [WPTools]

Figure 1 - Default LaunchPad

9606fg01.jpg

Fragment 2 - Default LaunchPad Properties

/* 9606FG02.TXT - Default LaunchPad properties */
class    = "WPLaunchPad"
title    = "LaunchPad"
location = ""
setup    =,
   "DRAWEROBJECTS=1,;"                              ||,
   "DRAWEROBJECTS=2,<WP_DOSWIN>;"                   ||,
   "FPOBJECTS=,<WP_OS2WIN>,<WP_TUTOR>,<WP_SHRED>;"  ||,
   "LPACTIONSTYLE=TEXT;"                            ||,
   "LPCLOSEDRAWER=NO;"                              ||,
   "LPDRAWERTEXT=NO;"                               ||,
   "LPFLOAT=NO;"                                    ||,
   "LPHIDECTLS=YES;"                                ||,
   "LPSMALLICONS=NO;"                               ||,
   "LPTEXT=NO;"                                     ||,
   "LPVERTICAL=NO;"                                 ||,
   "TITLE=LaunchPad;"                               ||,
   "OBJECTID=<WP_LAUNCHPAD>;"                       ||,
   ""
call SysCreateObject class, title, location, setup, "R"

Figure 3 - LaunchPad built by 9606ls01.cmd

9606fg03.jpg

Fragment 4 - Faceplate / Drawer Group

f=f+1; faceplate.f = '<WP_OS2WIN>'

d=0
d=d+1; drawer.f.d ='<WP_WINFS>'
d=d+1; drawer.f.d ='<WP_WIN2WIN>'
d=d+1; drawer.f.d ='<WP_DOSFS>'
d=d+1; drawer.f.d ='<WP_DOSWIN>'
d=d+1; drawer.f.d ='<WP_OS2FS>'
       drawer.f.0 = d