[comp.sys.atari.st] desk accessories

m204help@cca.UUCP (05/29/87)

I have a 520st at home and am contemplating a 1040st.
I want to use the 1040 in my 'live' keyboard setup with my band.
What I would like to do  is have a sequencer program loaded and also
have quick access to some other programs.
Is it possible to make any program a desk accessorie ?
Are there special rules for what can be a desk accessorie ?
Could I have my main program loaded and also have 2-3 other programs
either written by myself or purchased, loaded as accessories ?
All responses via net mail would be appreciated.
keith hedger

manis@ubc-cs.UUCP (06/02/87)

In article <16225@cca.CCA.COM> m204help@cca.CCA.COM (Keith Hedger) writes:

>Is it possible to make any program a desk accessorie ?
Within limitations, it is possible to write a desk accessory to do almost
anything that a full-fledged application can do. Exceptions (apart from the
obvious ones such as memory--a DA is loaded at boot time, and takes up space
whether you use it or not) include the inability for DA's to have menus, and 
some restrictions imposed by various language implementations. Programming
systems which I *know* support the creation of DA's include the Atari
C Developer's Kit, Mark Williams C, and TDI Modula-2. Many other systems
support the creation of DA's, but those are the ones whose documentation I
have seen. (I have never written a DA, so please don't ask me for advice).
As far as I know, it is *impossible* to write a DA in Atari Basic.

In general, a DA writer had better understand GEM pretty clearly. Although 
it doesn't cover DA's specifically, the Sybex "GEM Programmer's Guide" is an
invaluable introduction.

>Could I have my main program loaded and also have 2-3 other programs
>either written by myself or purchased, loaded as accessories ?
You can't turn an application into a DA or vice versa. Other than that, the
only other restriction is the limit of 6 DA slots that GEM imposes. 

-----
Vincent Manis                {seismo,uw-beaver}!ubc-vision!ubc-cs!manis
Dept. of Computer Science    manis@cs.ubc.cdn
Univ. of British Columbia    manis%ubc.csnet@csnet-relay.arpa  
Vancouver, B.C. V6T 1W5      manis@ubc.csnet
(604) 228-6770 or 228-3061

"The difference between capitalism and communism is obvious: under capitalism,
 man exploits man, while under communism, it is exactly the opposite."

john@viper.UUCP (06/03/87)

In article <1432@ubc-cs.UUCP> manis@ubc-cs.UUCP (Vincent Manis) writes:
 >In article <16225@cca.CCA.COM> m204help@cca.CCA.COM (Keith Hedger) writes:
 >>
 >>Could I have my main program loaded and also have 2-3 other programs
 >>either written by myself or purchased, loaded as accessories ?
 >You can't turn an application into a DA or vice versa. Other than that, the
 >only other restriction is the limit of 6 DA slots that GEM imposes. 
 >

 Applications can only be turned into desk accessories by rewriting them.
Vincent is correct as far as desk accesories are concerned, but there is 
an alternative that would address the underlying question Keith seems to 
be getting at...  Since Keith just wants to be able to access multiple 
application programs (which he probably doesn't have source code for), 
the alternative is using a program called K-Switch.  This is a "switcher" 
(not a multi-tasker) which allows multiple application programs to be
loaded at the same time and for the user to "switch" back and forth 
between the various programs using a special keystroke.

  Using K-Switch takes -Lots- of memory.  It essentialy divides your ST's 
memory to create multiple psudo-ST's.  Even with this disadvantage, it's 
still a very useful program as long as you have the memory and the need 
to have more than one application available at the same time.

--- 
John Stanley (john@viper.UUCP)
Software Consultant - DynaSoft Systems
UUCP: ...{amdahl,ihnp4,rutgers}!{meccts,dayton}!viper!john

minow@decvax.UUCP (Martin Minow) (06/04/87)

In article <1432@ubc-cs.UUCP> manis@ubc-cs.UUCP (Vincent Manis)
discusses desk accessories, implying that they cannot have menus.
Actually, there is no problem with menus (CONTROL.ACC and EMULATOR.ACC
both have menus.  However, it may well be the case that they can't
have separate resource files.  Thus, you have to roll your own
menu data structure, which is moderately painful, but not impossible.
As Vincent noted, the Sybex book is very useful in this regard.

Sources to a "desktop" accessory were posted to comp.sys.atari.st
a few months ago.  It didn't have a menu, but the interaction
with Gem was fairly clear.

Martin Minow
decvax!minoha

manis@ubc-cs.UUCP (06/04/87)

In article <86@decvax.UUCP> minow@decvax.UUCP (Martin Minow) writes of 
DA's:
>However, it may well be the case that they can't have separate resource
>files.
This is indeed the case. There's apparently a bug with the Resource Library:
if you use RsrcLoad in a DA, it wastes a considerable amount of memory
(about 40K). TDI Modula-2 comes with a program called the Resource Embedder,
which turns a resource file into Modula-2 code. If you're using another
language, you'll pretty well have to do it yourself.

My original remark about menus was imprecise. I was specifically referring
to what you can do on the Mac, where a DA can install a menu on the menu
bar, unbeknownst to the host application. The "Keycaps" DA on the Mac uses
that to add a "Font" menu. I don't know how that can be done on GEM.

-----
Vincent Manis                {seismo,uw-beaver}!ubc-vision!ubc-cs!manis
Dept. of Computer Science    manis@cs.ubc.cdn
Univ. of British Columbia    manis%ubc.csnet@csnet-relay.arpa  
Vancouver, B.C. V6T 1W5      manis@ubc.csnet
(604) 228-6770 or 228-3061

Nothing in the above should be taken as a criticism of Her Majesty's
Government of British Columbia, as pointing out errors in legislation
introduced by Her Majesty's Government, or in any other way which might be
deemed as illegal, seditious, or treasonable by Her Majesty's Government of
British Columbia.

hi2cah@sdcc13.ucsd.EDU (John "Tushie" Ogawa) (06/05/87)

<<EAT AT JOE'S>> <<NOT AT MINE>>

As the author (unfortunately) of a desktop accessory (that I *am*
working on, it should be out on Sunday) I thought I'd throw my
(probably wrong) advice into this discussion:

It is entirely possible to have menus in DA's. It is also possible
to have separate RSC files. However, the latter requires some
special attention. You can (according to the documentation that I
have) only have one resource tree loaded with rsrc_load in memory at
a time per running program. Since DA's are constantly running (in a
sense) you can only have one RSC file per DA *and* application. This
means that if you have a DA with a separate RSC file loaded, you
*cannot* run an application that loads its own RSC file. Early
versions of SCHIZO.ACC that had separate RSC files would crash if
you tried to run them after leaving Uniterm. There are 2 ways of
solving this problem. 1)Write your own resource tree by hand or
include it as C code generated by a Resource Constructor, and
2)Free the memory allocated for the resource tree before leaving the
DA. I chose the first method for SCHIZO since it did not require
time consuming disk reads to load the RSC file *every* time the DA
was called. The second method requires the use of rsrc_free before
calling the evnt_multi loop again. You must also load the RSC file
with rsrc_load when coming out of the evnt_multi loop.

Whew! I realize the above discussion was not the clearest. I hope
that it does help future DA writers though. All information was
gained through hair-tearing experimentation and the patience of
several ST gurus. In other words, it may be wrong. But, it may be
right. Who knows :-).

I'd be happy to answer any questions concerning DAs and RSC files
until this account goes away (June 14th). After that look for me on
GEnie.

Happy Hacking!

John Ogawa

GEnie: TUSHIE
NET: ps136sag@sdcc13.ucsd.edu <or> ...ucbvax!sdcsvax!sdcc13!ps136sag

PLEASE SEND MAIL TO ADDRESS ABOVE!