#auto-selecting gadgets
5 messages in this thread
Unfortunately, I don't have up-to-date 1.2 docs for intuition etc., and I'd
like to take advantage of a 1.2 feature in a program I'm writing.
How do I set up a string gadget so that a user does not need to click in it
before typing?? I tried setting SELECTED in Gadget.Flags and it then put a
cursor in the gadget, but still wouldn't allow me to type until I clicked in
it.
In case it matters, the string gadget in question is a part of a requester
which also contains a boolean gadget. I have everything working like a charm
except for auto-selecting, so I think all that's left is to find the relevant
difference between 1.1 and 1.2. Suggestions?
Hopefully someone else will jump in — I don't have my reference in front of me
now but I _think_ it's ActivateGadget(rp, gadget).
ActivateGadget — Activate a (String) Gadget.
SYNOPSIS
Success = ActivateGadget(Gadget, Window, Request)
D0 A0 A1 A2
BOOL Success;
struct Gadget *Gadget;
struct Window *Window;
struct Requester *Request;
FUNCTION
Activates a String Gadget. If successful, this means that the user
does not need to click in the gadget before typing.
The Window parameter must point to the window which contains the Gadget.
If the gadget is actually in a Requester, the Window must contain
the Requester, and a pointer to the Requester must also be
passed. The Requester parameter must only be valid if the Gadget
has the REQGADGET flag set, a requirement for all Requester Gadgets.
The success of this function depends on a rather complex set
of conditions. The intent is that the user is never interrupted from
what interactions he may have underway.
The current set of conditions includes:
– The Window must be active. (Use the ACTIVEWINDOW IDCMP).
– No other gadgets may be in use. This includes system gadgets,
such as those for window sizing, dragging, etc.
– If the gadget is in a Requester, that Requester must
be active. (Use the REQSET and REQCLEAR IDCMP).
– The right mouse button cannot be held down (e.g. menus
INPUTS
Gadget = pointer to the Gadget that you want activated.
Window = pointer to a Window structure containing the Gadget.
Requester = pointer to a Requester (may by NULL if this isn't
a Requester Gadget (i.e. REQGADGET is not set)).
RESULT
If the conditions above are met, and the Gadget is in fact a String
Gadget, then this function will return TRUE, else FALSE.
————————-From the latest Autodocs, available from CBM… see
CBM.DOC in DL 1
Regards, Larry.
Thankyou very much. Actually, it dawned on me last night that I still had a
paper copy of the 1.2G1 autodocs, so I answered my own question. That business
of having to watch for REQSET is a pain! (but, I did get my code working).
Close, but no cigar. The filename is actually DL1:CBMDOC.TXT.
Rick