#Benchmark RefreshGList
Has anyone had any problems using RefreshGList; specifically with the
Benchmark compiler? No matter what number I give it for how many gadget to
refresh, it allways does all the gadgets from the gadget I pass it to the
last gadget. The only workaround I have found is to temporarily store the
NextGadget var, NIL it out, RefreshGList, and then restoreNextGadget.
The purpose behind this particular procedure is to refresh a text boolean
gadget, and allow you to change the text depnding on whether it is selected
or not; Or to allow you to have one gadget do "Dotted Lines", "Solid Lines",
"Double Lines", ect. PROCEDURE ReWrtGad(GW:Window; REQ : RequesterPtr; GAD :
Gadget;
txt : ADDRESS); VAR
tgp : GadgetPtr; BEGIN
WITH GW DO
WITH GAD DO
WITH GadgetText^ DO
IF (txt # NIL) THEN
IText := txt; END;
IF (Selected IN GAD.Flags) THEN
SetAPen(RPort^,CARDINAL(FrontPen));
SetBPen(RPort^,CARDINAL(BackPen)); ELSE
SetAPen(RPort^,CARDINAL(BackPen));
SetBPen(RPort^,CARDINAL(FrontPen)); END;
END;
RectFill(RPort^,LeftEdge,TopEdge,LeftEdge+Width,TopEdge+Height);
tgp := NextGadget;
NextGadget := NIL;
RefreshGList(GAD,GW,NIL,1);
NextGadget := tgp;
END;
END; END ReWrtGad;
I have the same problem with RefreshGList in other procedure's that use
RefreshGList, so I odnt think it is my usage, but anything is possibe :^)
PROCEDURE UnsSelGad();
VAR
tgp : GadgetPtr;
BEGIN
IF (Selected IN gptr^.Flags) THEN
EXCL(gptr^.Flags,Selected);
IF (GadgImage IN gptr^.Flags) THEN
tgp := gptr^.NextGadget; gptr^.NextGadget := NIL;
RefreshGList(gptr^,window,NIL,1); gptr^.NextGadget := tgp;
ELSE
ReWrtGad(window,NIL,gptr^,NIL);
END;
END;
END UnsSelGad; This is used when I want to toggle between 2 or more
gadget's , turning one on, and all the other's off.
Any suggestions would be appreciated.
Jim Vogel