As mentioned earlier, Workbench is a special case public screen because it is the initial default public screen. There are other reasons Workbench has a special status. Normally, it's the first thing the user sees because it is the default user interface on all Amiga computers. Many older applications written for V34 and earlier versions of the OS expect to run in the Workbench screen. Also, Workbench is currently the only public screen supported by system Preferences and the only screen Intuition can automatically open. Because of its close ties with the operating system, there are some extra functions available to manipulate the Workbench screen. One function which controls both Workbench and other public screens is setpubscreenmodes(). this function controls the global public screen mode bits, SHANGHAI and POPPUBSCREEN. If the SHANGHAI mode bit is set, older applications which expect to open on the Workbench screen will open instead on the default public screen (which may or may not be the Workbench screen). The POPPUBSCREEN bit controls whether public screens will be popped to the front when a window is opened. These modes are documented in the "Intuition Windows" chapter in the section on "windows and screens". Other functions which control the Workbench screen are listed in the table below. Table 3-6: Workbench Public Screen Functions ______________________________________________________________________ | | | wbenchtoback() move the workbench screen behind all other | | screens. | | | | wbenchtofront() move the workbench screen in front of all other | | screens. | | | | openworkbench() open the workbench screen. if the screen is | | already open, this call has no effect. This call | | will re-awaken the Workbench application if it | | was active when CloseWorkBench() was called. | | | | closeworkbench() attempt to reclaim memory used for the workbench | | screen. If successful, this call closes the | | screen and puts the Workbench application to | | sleep. This call fails if any application has | | windows open or locks on the Workbench screen. | |______________________________________________________________________| Programs can attempt to reclaim memory used by the Workbench screen by calling CloseWorkBench(). Programs that have closed Workbench, should call OpenWorkBench() as they exit or allow the user to re-open the screen through a menu or gadget. If Workbench is closed, any of the following events can re-open it: calling OpenWorkBench(); opening a window on the Workbench (including easyrequests() such as the dos "insert disk" requester); calling lockpubscreen("workbench"); calling lockpubscreen(null) when workbench is the default public screen.