So What Techncial Notes
#9

Call Box
Custom Desktops

Written by: William Stephens - February 22,1990

This technical note describes how to make desktops containing patterns or pictures instead of the standard desktop colors.

You can set the desktop color by using the screen color call CALL SC,2,$???? after calling CALL TL,2,"DESK" and this is quite straight forward and simple .. but if you want some pattern or even a picture as your desktop you need to use a different process. This process requires you to use the Tool Locator call MessageCenter before calling CALL TL,2,"DESK".

The Window Manager which handles desktop drawing looks for a desktop message before it creates one. If a desktop message is present then the Window Manager uses the information in this message to draw the desktop, if no message is found then it uses the standard default colors (usually Periwinkle blue in 640 mode or light blue in 320 mode). The Toolbox Reference Manual describes this message as follows:
        -----------------------
    +0  |                     |
        |--    Reserved     --| Long     Any Value... make it 0
        |                     |
        -----------------------
    +4  |      MessType       | Word     2 is the Desk Message
        -----------------------
        |                     | Word     0 = Pattern, 1 = Picture
        -----------------------
        |                     | Data     32 bytes of pattern data or 32000 bytes
        |                     |
               DrawData                  of picture data
        |                     |
        |                     |
        -----------------------
Making a Message ...

To make a pattern message put yourself in plain old Applesoft BASIC and type CALL -151, this puts you in the monitor. Type in the following line:

1000: 00 00 00 00 02 00 00 00

Next you either type in 32 bytes of data which is a pattern or if you have some saved to disk BLOAD them at $1008. Now issue the following command:

BSAVE PATTERN.MESS,A$1 000,L$28

This saves the message to disk as the file PATTERN.MESS.

Making a picture message is very similar, but you first need to take a filetype $C1 picture and change its filetype to BIN (Use the File Utilities in the Call Box Launching Shell) and then BLOAD it at $1008. Now from the monitor type in the following line:

1000: 00 00 00 00 02 00 01 00

Next type in this line:

BSAVE PICTURE.MESS,A$1000,L$7D08

This is all there is to it!

Using the Message ...

After you startup the Call Box BASIC Driver (-CB) and load in its variables (RESTORE CB.VARS) you need to load and then pass the message. Use the GS/OS load code presented in tech note 6 to load in your message:

GOSUB 56000 : A$ = "(pattern or picture).MESS" : GOSUB 50000

Next you pass the message handle to the message center:

CALL LC,1 ,2,_H\$1501\

Now when you issue the CALL TL,2,"DESK" your picture or pattern will fill the desktop. This condition will persist until you shutdown your IIgs or you issue a delete message command ..

CALL LC,3,2,_H\$1501\

As I said, this condition persists even if you "BYE" out of Applesoft into a GSIOS Launching program ... If this launcher is a desktop application like Hyperlaunch or the Finder the desktop will still be in the style you put it in with these commands.


Further Reference
Apple IIgs Toolbox Reference: Volume(s) 1,2 and 3


Call Box - So What Software 10221 Slater Ave. Suite 103 Fountain Valley, CA. 92708