English Amiga Board

Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

Thread Tools
Old 07 September 2018, 03:51   #1
Registered User

Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 45
Question 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.
Warty is offline  
Old 07 September 2018, 08:14   #2

Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 387
select the gadget before activating
              SelectGadget(g, w->RPort, 0);
              if ((g->GadgetType & GTYP_STRGADGET) == GTYP_STRGADGET)
                ActivateGadget(g, w, 0);
bebbo is offline  
Old 07 September 2018, 19:08   #3
Registered User
Join Date: Aug 2004
Posts: 3,091
What library is SelectGadget() in?

Are you waiting to receive IDCMP_ACTIVEWINDOW before calling ActivateGadget()? Apparently that is necessary.
mark_k is offline  
Old 08 September 2018, 07:35   #4
Registered User

Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 45
Thanks for the link, that sorted it out!
Warty is offline  

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 22:59.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07482 seconds with 15 queries