[net.micro.amiga] Mutual-Exclude Gadgets

kdd@well.UUCP (Keith David Doyle) (06/16/86)

References:


The following message was originally addressed to jmm@amiga.uucp, but
bounced back.

To: jmm@amiga.uucp
Subject: Mutual Exclude Gadgets

Hi,

   The problems I have been having with Mutual Exclude gadgets, seem
to stem from an effect that occurs when doing a RefreshGadgets() multiple
times when a gadget is selected.  I've found that a gadget actually seems
to want to go through 4 states each time it is refreshed when the selected
bit is on in the gadget structure.  First, the background is highlighted,
then, the background is normal and the character is highlighted (different
color), next, both the character and the background are highlighted, and
finally, back to the normal un-highlighted state.  I found that the
closest thing to a 'cure' is to always do RefreshGadgets() twice, which
works, but leaves 'selected' gadgets with the text merely a different 
color which dosen't really highlight the gadget enough to be recognizable
in many cases (especially if the background is a light color with dark
foreground colors).  One rather ugly bug seems to have gone away with
1.2beta2, and that is the fact that 1.1 would do a RefreshGadgets() when
re-selecting a window, causing selected gadgets to rotate through the
4 state sequence previously described, and ending up out of phase with
the intended display of the gadgets state.  The only 'example' program
I have of mutual-exclude gadgets is speechtoy.c (though there was a
reference to such an 'example' with the 1.2beta2 distribution, there were
no examples at all on the 'includes & examples' disk, and none of the
examples on the 'SW Toolkit' disk seemed to do anything with gadgets.
SpeechToy dosen't seem to exhibit this problem, and I haven't yet fully
researched what the differences are.  I am using a very basic gadget
with a border and text but no select vs unselect images.  I'm depending
on Intuition to highlight the gadget as selected or not.  I will try to
see if I can produce a simple C program to illustrate the problems I
have been having.  I will probably start from Draper's gad.c example
program, because that is what I started with learning about gadgets.
I am using RemoveGadget(), AddGadget, but don't think the problem is
related to them, because I can simply do a RefreshGadgets() and toggle
the gadget state around without having to mess with the gadget at all
once the selected flag is on in the gadget structure.

It is as if RefreshGadgets() is doing a XOR to the screen, which fails
to keep the proper gadget display when a gadget is selected and is
refreshed a variable amount of times.

Keith Doyle

dpvc@ur-tut.UUCP (David Cervone) (06/18/86)

In article <1286@well.UUCP> kdd@well.UUCP (Keith David Doyle) writes:
>
>   The problems I have been having with Mutual Exclude gadgets, seem
>to stem from an effect that occurs when doing a RefreshGadgets() multiple
>times when a gadget is selected.  I've found that a gadget actually seems
>to want to go through 4 states each time it is refreshed when the selected
>bit is on in the gadget structure.  ... [more description]
>
>Keith Doyle

I have encountered the same problem.  I have written an implementation of
mutual-exclude gadgets (in C) that makes this work somewhat better.  GADGHCOMP
and GADGHBOX still can get messed up in window gadgets, but work pretty good
with requester gadgets.  Image gadgets work just fine (as always).  I am 
working on the documentation, and plan to post it as soon as it is done, but 
if people really need it right away, I can mail it to people now and send out 
the documentation when it is done.  If nobody wants it at all, I won't have 
to write any more documentation.  Any takers?

Please send e-mail, as I am behind in my reading.

Davide P. Cervone
University of Rochester
UUCP:  ur-tut!dpvc
BITNET: DPVC@UORDBV

jimm@amiga.UUCP (Jim Mackraz) (06/18/86)

In article <1286@well.UUCP> kdd@well.UUCP (Keith David Doyle) writes:
>
>The following message was originally addressed to jmm@amiga.uucp, but
>bounced back.
>

from the Well, try hplabs!pyramid!amiga!jimm.  Also, be sure to 
address it to amiga!support or amiga!bugs, too.

>Subject: Mutual Exclude Gadgets
>
>   The problems I have been having with Mutual Exclude gadgets, seem
>to stem from an effect that occurs when doing a RefreshGadgets() multiple
>times when a gadget is selected.  I've found that a gadget actually seems
>to want to go through 4 states each time it is refreshed when the selected
>bit is on in the gadget structure.  ...
> I found that the
>closest thing to a 'cure' is to always do RefreshGadgets() twice, which
>works, but ...

This is a bit weird.  The only similar problems I have heard come from
trying to use Border structures in gadget rendering.  But even then ...

You said you might produce a small example program.  This is BY FAR
the most welcome contribution y'all beta bug bashers can provide.
I anxiously await same example.

>I will probably start from Draper's gad.c example
>program, because that is what I started with learning about gadgets.

You might also look at other public domain programs, such as speechtoy.

	thanks, and keep banging.
	jimm