[comp.sys.amiga] String Gadgets resolved!

Steve_A_Hales@cup.portal.com (12/13/87)

Aloha All!
    Thanks for the replies, with all your help I solved the problem.  No I was
not using HeloisMouse.  I am not using a Requestor window.  I was opening a
normal window, and then I wanted to activate a string gadget on it.
Stuart Ferguson suggested that I use something like this:
         Delay(5L);
         ActivateGaget(...

And this worked just fine.  It seems that ActivateGadget operates asyncronsly
(sp?)  so the Delay just hangs around until the OS can catch its breath.

Thanks to all who responded, mahalo!

   Steve Hales


UUCP: Steve_A_Hales@cup.portal.com

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (12/15/87)

In article <1958@cup.portal.com> Steve_A_Hales@cup.portal.com writes:
>Aloha All!
>    Thanks for the replies, with all your help I solved the problem.  No I was
>not using HeloisMouse.  I am not using a Requestor window.  I was opening a
>normal window, and then I wanted to activate a string gadget on it.
>Stuart Ferguson suggested that I use something like this:
>         Delay(5L);
>         ActivateGaget(...
>
	This doesn't sound right to me.  Window opening *should* be
synchronous i.e. the window is valid when OpenWindow() returns (at least
that's the assumption I've been working on).  Therefore, ActivateGadget()
should be a valid operation right after OpenWindow().

	Mackraz?  Any ideas?

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_		Recumbent Bikes:	      dual ---> !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor

guilford@sunlight.steinmetz (james d guilford) (12/22/87)

In article <4731@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
>In article <1958@cup.portal.com> Steve_A_Hales@cup.portal.com writes:
>>                                                          I was opening a
>>normal window, and then I wanted to activate a string gadget on it.
>>Stuart Ferguson suggested that I use something like this:
>>         Delay(5L);
>>         ActivateGaget(...
>>
>	This doesn't sound right to me.  Window opening *should* be
>synchronous i.e. the window is valid when OpenWindow() returns (at least
>that's the assumption I've been working on).  Therefore, ActivateGadget()
>should be a valid operation right after OpenWindow().
>
>	Mackraz?  Any ideas?
>
>_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
>Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
> \_ -_		Recumbent Bikes:	      dual ---> !{well,unicom}!ewhac
>O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
>"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor


As far as I understand it, the window is "valid" after OpenWindow
returns. It just may not be rendered yet. If you try drawing on it,
everything works as one would expect. The problem lies in
ActivateGadget. It is really fussy about when it will work. The
conditions under which it will not work are very long (window not
activated, user doing strange things with mouse, etc.). If you call it
right after OpenWindow, then the window isn't rendered and it becomes
a nop. The proper solution that I know of is to wait for some message
from the system (I can't recall which off hand) that means the window
is actually rendered, and then call ActivateGadget. I hacked this into
vt100 rel2.6 and I've had no problems with it. It seems to me that
this is much cleaner than putting an arbitrary delay into things. 
I would therefore say that the problem is in ActivateGadget, and not
in OpenWindow.

--JimG
(guilford@csv.rpi.edu)