There may be many paths to a particular point in the code, some of which will leave the gadget hidden and some showing.
At this point, I want to fill the gadget (in this case a textgadget), show it and after a while restore its previous content and maybe hide it again. But hide it only if it was previously hidden. All very simple, except for the lack of a function to tell me whether a gadget is currently hidden.
Code: Select all
Protected.i hh
Protected.s st
st = GetGadgetText(#txtgad)
hh = IsVisible(#txtgad) <<<< or something functionally equivalent
SetGadgetText(#txtgad, "Here is the latest news")
HideGadget(#txtgad, 0)
--do some other stuff--
HideGadget(#txtgad, hh)
SetGadgetText(#txtgad, st)