[comp.sys.atari.st] Bug in GEMFAST

to_stdnet@stag.UUCP (03/10/89)

From: thelake!steve@stag.UUCP (Steve Yelvington)


 agray@eriskay.axion.bt.co.uk (Andy Gray) writes...

>Has anyone tried writing programs with Sozobon in conjunction with the GEMfast
>libraries yet? If so, have any problems with the AES library come to light. I
>have just cobbled together a quick program which has stood on it's head. The
>main problem seems to be within the 'form_alert' usage

 /* code omitted */

>	This cameo example should return 0, 1, or 2 according to the selected
>option. Hitting 'PRINT', however, inevitably returns 2, 'CANCEL' defaults etc
>!!!. 

Congratulations! You have found a genuine bug in GEMFAST -- probably not
the only one. It exists in GEMFAST 1.1, so I'm forwarding a bug report to
the author.

Don Farmer's GEMQ bindings do not have this bug.

By the way, when specifying the default button or when checking the
returned value, the buttons are numbered 1-2-3, etc., not 0-1-2, so beware
of that in the logic of your program. The 0 is reserved for "no default
button."

>The main text string is irksome, apparently not handling the text bounded
>by '|' properly. I'm sure these problems would have been noticed during
>testing, so where have I gone wrong. (The Megamax manual quotes that the text
>message can contain '4 lines of 32 characters each' and in the following line
>'5 lines of 32' characters. The DR GEM-AES manual states '5 lines of 40
>characters' the total not exceding 200 characters.)
>
>	What did I, rather than GEMfast, do wrong?
>
>	Andy Gray

When the AES figures out how big to draw the alert box, it considers the
text of the message and not the text of the buttons. You can force the
dialog to be wider by including spaces:
	switch(form_alert(NO_DEFAULT,
	 "[1][    Hello World                      ][SHOW|PRINT|CANCEL]")) 
and so on.

The Pollack & Weber book "Atari ST Application Programming" says there can
be four lines of 32 characters; Mark Williams' manual says five lines of
40. The final arbiter is the AES; see what works.


/*
 * UUCP: {uunet!rosevax,amdahl!bungia,chinet,killer}!orbit!thelake!steve
 * ARPA: crash!orbit!thelake!steve@nosc.mil
 * #member <STdNET> The ST Developers Network
 */