Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uunet!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!warwick From: warwick@batserver.cs.uq.oz.au (Warwick Allison) Newsgroups: comp.sys.atari.st.tech Subject: Re: DESKTOP ACC. Message-ID: <7089@uqcspe.cs.uq.oz.au> Date: 30 Jan 91 23:27:32 GMT References: <1991Jan22.133505.7640@umiami.ir.miami.edu> <18420006@hpsad.HP.COM> <1991Jan30.144626.16658@newcastle.ac.uk> Sender: news@uqcspe.cs.uq.oz.au Reply-To: warwick@batserver.cs.uq.oz.au Lines: 52 In <1991Jan30.144626.16658@newcastle.ac.uk> D.M.Johnson@newcastle.ac.uk (Dave Johnson) writes: > I want to include resource files in the program, but as the prgoram is a D.A. >it should be in the code. How do I find the objects in the resource file >if I have just forced it to be included with the compiled code. Why put them in the DA? I think this is being a bit presumptuous of you... How do you like it when you get software with a German RSC? At least with a resource file you can change it. And on this point, I wish people would stop using form_alert(2,"[Are you sure?][Yes|No]"), rather than a free string, or Resource Alert from a .RSC file. Human-Language dependent programs are a bit rude, especially on a system that has heaps of European support... ANYWAY... > Any tips on writing D.A.s is very useful as I have seen no documention >on how to write them. Have you written a GEM program? DA's are similar... Do you initialisation: (if "initialisation" was in a .RSC, you could change it to initialization) 1. Get your appl id (using appl_init, as for a GEM program) 2. Register the name of your application (use menu_register) 3. Load your RSC (use rsrc_load) 4. Whatever else you want (create buffers, etc.) Then: while (1) { get an event (using event_multi, or event_msg) if the event is an AC_OPEN, do whatever you want to do. } Basically, it is a GEM program + menu_register + AC_OPEN handling, so you should be able to convert a GEM program pretty well. One note though, I don't think DA's are given access to keyboard events, so you may have to circumvent this somehow. (Any clues?) WARNING: I am a Modula-2 programmer, and my FTL M2 compiler, or my memory may cause slight differences from the normal identifiers. -- ________________________________________________________ This .signature intentionally left blank ________________________________________________________