[comp.sys.amiga.tech] Activating Gadgets in C

barrett@meridn.enet.dec.com (Keith Barrett) (08/02/90)

I need help with gadgets in C.  I created a database that uses string gadgets
as input.  The problem is I can't get the gadgets to auto-activate so that you
don't have to click the mouse on the string gadget to activate it.  So you
should just be able to type and when you hit return it should activate the next
gadget.  I set the SELECTED bit in the gadget but all this does is make the
cursor appear but you still have to click on the gadget.
	The only method I can think of would be feeding INTUITION false mouse
movement, but that seems a little messy.  Any help would be appreciated.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		"I'm Bart Simpson - who the hell are you?"

Keith G. Barrett - Software Specialist     Internet: barrett@meridn.enet.dec.com
Digital Equipment Corp. "DEC has it now"       UUCP: decwrl!meridn.enet!barrett
  //					 "Wait'll they get a load of me" - Joker
\X/  "The Amiga is really a picoVAX"	    "You won't get it!" - the Prisoner
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ric@hpspdra.HP.COM (Ric Peregrino) (08/04/90)

 About the string gadgets. If you look in the RKM gadgets chapter,
you'll find ActivateGadget() which you can use to activate the string
gadget only if the window it is in is already active. You could set
ACTIVEWINDOW | INACTIVEWINDOW IDCMP flags to find out about the state
of your window.

  In using string gadgets I found that after hitting return the text
entered remains. Clearing the string buffer and RefreshGadget will clear
it but it will also make the undo buffer unuseable, it seems.

  Also, with a COMMSEQ Q menu pick for quitting your program, with the
string gadget active causes a funny thing on my A2000 1.3 when a
program was invoked from a shell; the invoking shell is inacticve and
can't be activated until the mouse is clicked outside of the shell. 
No big problem just interesting. I tried to RemoveGadget to de-activate
the string gadget to no avail. How do you de-activate the string gadget?

ric@hpspd

peter@cbmvax.commodore.com (Peter Cherna) (08/06/90)

In article <13580003@hpspdra.HP.COM> ric@hpspdra.HP.COM (Ric Peregrino) writes:
>
>  In using string gadgets I found that after hitting return the text
>entered remains. Clearing the string buffer and RefreshGadget will clear
>it but it will also make the undo buffer unuseable, it seems.

That is the normal correct behavior for a string gadget, so the user
can go back and make further changes.  The user shouldn't have to be
forced down a linear path through your user-interface.  Let him go back.

The undo buffer holds the contents of the string gadget when the user
began to edit it.

>  Also, with a COMMSEQ Q menu pick for quitting your program, with the
>string gadget active causes a funny thing on my A2000 1.3 when a
>program was invoked from a shell; the invoking shell is inacticve and
>can't be activated until the mouse is clicked outside of the shell. 
>No big problem just interesting. I tried to RemoveGadget to de-activate
>the string gadget to no avail. How do you de-activate the string gadget?

You cannot deactivate a gadget programmatically.  Make sure you aren't
calling ActivateGadget() after you've already closed your window.  That
would put Intuition into a limbo-state.

>ric@hpspd

     Peter
--
     Peter Cherna, Software Engineer, Commodore-Amiga, Inc.
     {uunet|rutgers}!cbmvax!peter    peter@cbmvax.cbm.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"This is a one line proof...if we start sufficiently far to the left."