[comp.sys.amiga.tech] Updating text in Bool gadgets

kim@beowulf.ucsd.edu (Geoffrey K Kim) (05/02/89)

I'm having problems updating the text in my boolean gadgets.  I would 
appreciate it if someone could help.  Here's the situtation:

I have a boolean gadget with text that I want to alternate between
the strings: "YES", "NO", and "MAYBE".

The problem is that when I change the gadgets Intuitext structure so that
it contains a new string, instead of replacing the old string, it overwrites
it (OR mode?).  I tried JAM2, and JAM1 in the IntuiText structures, with the
same results.  Anyone know what the problem is?


Thanks in advance.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| kim @beowulf.UCSD.EDU (Home of the Garden Weasles)                  |
|        "... ENGAGE!" -- Jean Luc Picard, STTNG                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

papa@pollux.usc.edu (Marco Papa) (05/03/89)

In article <6342@sdcsvax.UCSD.Edu> kim@beowulf.UCSD.EDU (Geoffrey K Kim) writes:
>I'm having problems updating the text in my boolean gadgets.  I would 
>appreciate it if someone could help.  Here's the situtation:
>I have a boolean gadget with text that I want to alternate between
>the strings: "YES", "NO", and "MAYBE".
>The problem is that when I change the gadgets Intuitext structure so that
>it contains a new string, instead of replacing the old string, it overwrites
>it (OR mode?).  I tried JAM2, and JAM1 in the IntuiText structures, with the
>same results.  Anyone know what the problem is?

This has been rehashed 20 times already, so quickly a few notes:

1. Boolean gadgets with text only cannot be updated as you mention. They
should have a bitmap associated, instead.

2. The usual way of doing this is to RemoveGadget, modify it, AddGadget,
and RefreshGlist (or RefreshGadgets)

Take a look at some source code that does "mutual excluded gadgets".

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=