🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #13000

Re: Refreshing Gadgets

#13000
From: Chuck McManis
Date: Sun, 04 Jun 1989 23:40
34 lines
2168 bytes
In article <16390@gryphon.COM> collins@pnet02.cts.com (Steven Collins) writes:
>When I try to refresh my list of gadgets using RefreshGList,
>any boolean gadgets that are currently selected (and therefore highlighted...)
>are complemented and therefore seem to change state.

Well they shouldn't "change state" they should already be in that state. 
When you call RefreshGList() Intuition looks at the SELECTED bit, and the 
highlight mode, and then "renders" is appropriately. One way of doing 
homemade Mutual Exclude is to track down the excluded but still selected
gadget RemoveGadget() it, reset the selected bit, AddGadget() it back in
and then RefreshGlist() it to have it displayed in the appropriate rendering
style.

But there is a caveat. Do not ever try to use Boolean gadgets with IntuiText
as part of the gadget. The reason is that Intuition doesn't know to refresh
these correctly and will only get it right one time out of 4. This is a known
deficiency of boolean gadgets. If you want correctly functioning boolgads the
only really foolproof way to do it is with a pair of images. 


> I would like to 
>be able to have my program change the state (and text) of these
>gadgets and then display their current state correctly. How does one
>do this? 

Since you mention text, I think you may have hit this bug. When I build
boolean gadgets with several kinds of text (buttons) I usually render them
into a bunch of little bitmaps and stick those in the gadgets.


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"A most excellent barbarian ... Genghis Kahn!"
Technical Details
Message-ID: <107989@sun.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ames!amdahl!oliveb!sun!pepper!cmcmanis
References: <16390@gryphon.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ames!amdahl!oliveb!sun!pepper!cmcmanis
From: cmcmanis%pepper@Sun.COM (Chuck McManis)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Refreshing Gadgets
Message-ID: <107989@sun.Eng.Sun.COM>
Date: 4 Jun 89 23:40:09 GMT
References: <16390@gryphon.COM>
Sender: news@sun.Eng.Sun.COM
Reply-To: cmcmanis@sun.UUCP (Chuck McManis)
Organization: Sun Microsystems, Mountain View
Lines: 34