Classic Computer Magazine Archive COMPUTE! ISSUE 73 / JUNE 1986 / PAGE 77

Custom Title Bars
For ST BASIC


George Miller, Assistant Technical Editor

This short program demonstrates how to put a custom title on ST BASIC's Output window. It works on all Atari ST-series computers.


ST BASIC puts four windows on the screen entitled Command, List, Edit, and Output. The Output window is where your programs actually run, and the window always displays the same title at the top of the screen: Output. By now you're probably tired of staring at this title bar and wish there was some way to change it.
    Fortunately, there is. Not with a built-in BASIC command, however. You have to call a routine in a part of the ST's operating system known as AES (Application Environment Services). The job is not difficult, but the ST BASIC manual lacks the necessary information for making system calls.
    When programming the ST, it's helpful to remember that the operating system contains many routines which can be of help. These routines are part of GEM, the Graphics Environment Manager, which is divided into two sections: AES and the VDI (Virtual Device Interface). These libraries contain almost all the routines necessary to handle screen output. Although VDI and AES routines are most easily accessed by programmers using C or machine language, ST BASIC programmers can also call them with the VDISYS and GEMSYS commands. It requires a little extra effort, though.
    The short routine listed below, "Custom Title Bars," is an example of a GEMSYS call to the AES library. It can be inserted into any ST BASIC program to display your program's title on the Output window's title bar. Run the routine to see what it does; then modify it in the following ways when using it in your own programs:
    1. Change line 20 to assign to the string variable title$ the name to be displayed in the title bar.
    2. Delete line 40, the END statement, and insert your own program at this point. However, be sure you insert an END statement at the end of your program and before line 63000. Otherwise, your program will fall through into the subroutine and cause an error.
    Before actually making the GEMSYS call in line 63040, the routine POKEs several parameters into system variables at the addresses pointed to by the built-in BASIC variable gintin. These parameters are required by this AES routine. The setup is done in lines 63010-63040.
    More information about calling VDI and AES routines can be found in the Atari documentation avail able to software developers and in COMPUTE!'s ST Programmer's Guide, published by COMPUTE! Books.

Custom Title Bars

10 FULLW 2:CLEARW 2
20 title$="New Title" : 'Define title$ =
     program title.
30 GOSUB titlebar
40 END : 'Start your program here.
63000 titlebar : 'Custom title bar routine.
63010 a# = gb : gintin = PEEK(a#+8)
63020 POKE gintin+0,PEEK(systab+8) :
          POKE gintin+2,2
63030 s# = gintin+4 : title$ = title$ +
          CHR$(0)
63040 POKE s#,varptr(title$) : GEMSYS
          (105)
63050 RETURN