Path: utzoo!mnetor!uunet!mcvax!unido!tub!actisb!federico From: federico@actisb.UUCP (Federico Heinz) Newsgroups: comp.sys.atari.st Subject: Re: fsel_input Message-ID: <194@actisb.UUCP> Date: 13 Mar 88 20:27:29 GMT References: <8802250623.AA17637@ucbvax.Berkeley.EDU> <3951@batcomputer.tn.cornell.edu> <3768@cup.portal.com> <497@lakesys.UUCP> Reply-To: federico@actisb.UUCP (Federico Heinz) Organization: Actis in Berlin GmbH, W. Germany Lines: 40 As a first excercise in GEM programming, and since it has been brought up recently in this newsgroup, I decided to take a hack at yet-another-fsel- -replacement. Not that the world is starving for one (I have FILEFIX and I like it a lot), but it seemed a nice way to learn to use buttons, sliders, etc. Of course, I decided to make the thing as a function (I'm doing it in C) first, then see how to tie it to the AES call. I started to work on the support code (which should better work unchanged when I go memory-resident), when I noticed the memory allocation problem. However I do it, I need to keep a list of all matching files in memory in order to sort it, go forward and backward through it, etc. I could reserve some static amount of memory and hope the user will never overflow it, but it seems a waste to me. I tried to determine whether FILEFIX goes this way by creating a directory with about 250 files, and it didn't overflow. It behaved somewhat funny (the "elevator" started to appear in very strange places), but it didn't crash. I suppose 250 is above any sensible heuristic amount one would want to statically allocate, so I assume that FILEFIX allocates memory dynamically. There again, I've repeatedly read in the net that Malloc is buggy, and that a certain amount of Malloc/Mfree calls per process fully messes up the system. Since such an add-on belongs to the caller process but cannot use the same memory pool, I must make at least one Malloc call per dialog and a later Mfree for it. This means that if the user calls my file selector often enough, he might crash the machine. Now tell me, how is it done? I had expected the user interface to be the "difficult" part (because I'm new to it). But, as usual, the environment bugs are taking the lion's share of my programming effort. By the way, would the author of FILEFIX contact me? I've got a bug report to do (and a few questions to ask). -- Federico Heinz "In Dubio Pro Libido" BIX: fheinz | Beusselstr. 21 UUCP: ...!unido!tub!actisb!federico | 1000 Berlin 21 Tel: (030) 396 77 92 | F.R. Germany.