07 September 2018, 03:51 | #1 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Intuition Requester: programmatically set focus on string gadget?
I am learning Intuition, porting an old Unix game to KS1.3. I've made a little library to handle requester creation for various purposes. One requester is of course to get info from the user, providing a textfield and an ok/cancel button. Is there actually a way to focus on the string gadget after opening the requester, so that the cursor is in there, and the user can just start typing? I found ActivateGadget, but that didn't do what I thought it might.
|
07 September 2018, 08:14 | #2 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
select the gadget before activating
Code:
SelectGadget(g, w->RPort, 0); if ((g->GadgetType & GTYP_STRGADGET) == GTYP_STRGADGET) { ActivateGadget(g, w, 0); } |
07 September 2018, 19:08 | #3 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,336
|
What library is SelectGadget() in?
Are you waiting to receive IDCMP_ACTIVEWINDOW before calling ActivateGadget()? Apparently that is necessary. |
08 September 2018, 07:35 | #4 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Thanks for the link, that sorted it out!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to free resources locked by MUI programmatically for auto-update | tygre | Coders. C/C++ | 8 | 08 October 2018 19:23 |
1.x Intuition knob gadget | arcanist | Coders. System | 0 | 30 January 2018 17:49 |
How to Programmatically Quit a MUI Application? | tygre | support.Apps | 2 | 02 March 2016 00:24 |
Closing current Shell window programmatically? | tygre | Coders. General | 5 | 06 September 2015 06:24 |
Gadget/Layout.gadget V44 | ruliovega | support.Apps | 6 | 02 January 2006 11:50 |
|
|