🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

String gadget problem

#12494
From: David Gay
Date: Wed, 03 May 1989 08:09
47 lines
2109 bytes
In article <not posted>, I wrote:
->I'm having some problems with ActivateGadget: I have two text gadgets, which
->I must refresh, and activate one of them. If I do the obvious
->
->RefreshGList(gadget1, req->RWindow, req, 1);
->RefreshGList(gadget2, req->RWindow, req, 1);
->if (something) ActivateGadget(gadget1, req->RWindow, req);
->else ActivateGadget(gadget2, req->RWindow, req);
->
->both gadgets end up with cursors (though only one is active).
->
->I must do the following to get things (partially) working:
->
->if (something)
->{
->    RefreshGList(gadget1, req->RWindow, req, 1);
->    ActivateGadget(gadget1, req->RWindow, req);
->    RefreshGList(gadget2, req->RWindow, req, 1);
->}
->else
->{
->    RefreshGList(gadget2, req->RWindow, req, 1);
->    ActivateGadget(gadget2, req->RWindow, req);
->    RefreshGList(gadget1, req->RWindow, req, 1);
->}
->
->Also, both versions of this code will not activate the same gadget twice
->consecutively (that is, ActivateGadget(gadget2), user presses return,
->ActivateGadget(gadget2) won't (always) work properly).
->
->Has anybody else had similar problems ? Any workarounds ?
->
Since then, I've found that doing a RefreshGList on a just deselected gadget
is what causes the problems (It seems to think that the gadget is still active
and displays a cursor). I've found (Prepare ASBESTOS suit) that the following
will 'cure' this (and the 2nd) problem (ASBESTOS suit now being worn):

IntuitionBase->ActiveGadget = NULL;

Any better workaround, or comments ?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Gay                                  6 x 9 = 42

GAY@ELDE.EPFL.CH, or GAY%ELDE.EPFL.CH@CLSEPF51.bitnet

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID: <890503090934.20801702@sic.epfl.ch>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!elde.epfl.ch!gay

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!elde.epfl.ch!gay
From: gay@elde.epfl.ch (David Gay)
Newsgroups: comp.sys.amiga.tech
Subject: String gadget problem
Message-ID: <890503090934.20801702@sic.epfl.ch>
Date: 3 May 89 08:09:34 GMT
Sender: usenet@ucbvax.BERKELEY.EDU
Lines: 47