[comp.sys.amiga.tech] A way to Deactivate a Window After it has been Activated??

rickf@pnet02.cts.com (Rick Flower) (05/19/89)

I've got a program that has multiple windows open at the same time, and I want
to make sure that the "main" window is always the active window and NOT one of
the other "informational" windows.. If the user selects one of these other
windows, is there a way to DeSelect it and return control to the main window??
I've already got it so that it will detect when the window has been activated,
but I can't deactivate it as of yet.. 

Thanks in advance...

===============================================================================
                                I Thought So...

UUCP: {ames!elroy, <backbone>}!gryphon!pnet02!rickf
INET: rickf@pnet02.cts.com
===============================================================================

thomas@cbmvax.UUCP (Dave Thomas QA) (05/19/89)

In article <15917@gryphon.COM> rickf@pnet02.cts.com (Rick Flower) writes:
> I've got a program that has multiple windows open at the same time, and I want
> to make sure that the "main" window is always the active window and NOT one of
> the other "informational" windows.. If the user selects one of these other
> windows, is there a way to DeSelect it and return control to the main window??
> I've already got it so that it will detect when the window has been activated,
> but I can't deactivate it as of yet.. 

The only to deactivate a window is to activate another one.  If you are
already detecting your output windows activation messages, then simply
ActivateWindow (inputwindow) whenever this happens.
 
> Thanks in advance...

Dave 
-- 
Dave Thomas, Commodore Amiga Test Engineering
UUCP  ...{allegra,rutgers}!cbmvax!thomas

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (05/19/89)

:I've got a program that has multiple windows open at the same time, and I want
:to make sure that the "main" window is always the active window and NOT one of
:the other "informational" windows.. If the user selects one of these other
:windows, is there a way to DeSelect it and return control to the main window??
:I've already got it so that it will detect when the window has been activated,
:but I can't deactivate it as of yet.. 
:
:Thanks in advance...

	You can always call ActivateWindow() when you get the ACTIVEWINDOW
IDCMP in one of the informational windows, but doing that sort of munging 
will interfere with autopoint programs like DMouse which always try to set
the window under the mouse to the active one.

	Better to have a shared IDCMP port for all the windows and not 
bother forcing one to be active over the others.

				-Matt

jimm@amiga.UUCP (Jim Mackraz) (05/23/89)

In article <8905191406.AA15536@postgres.Berkeley.EDU> dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) writes:
):I've got a program that has multiple windows open at the same time, and I want
):to make sure that the "main" window is always the active window and NOT one of
):the other "informational" windows.. If the user selects one of these other
):windows, is there a way to DeSelect it and return control to the main window??

)	You can always call ActivateWindow() when you get the ACTIVEWINDOW
)IDCMP in one of the informational windows, but doing that sort of munging 
)will interfere with autopoint programs like DMouse which always try to set
)the window under the mouse to the active one.

This is what the Workbench does for its Rename operation.  It is the
true test of AutoPoint stye programs.  I found that the correct
algorithm was for the AutoPoint program never to try to activate a
window which it has most recently tried to activate: try a window
once, and if it doesn't stick, don't try repeatedly.  This works
with Rename, and with anyone else calling ActivateWindow(): the
activation will not be "jerked away" by the AutoPoint tricks.

)	Better to have a shared IDCMP port for all the windows and not 
)bother forcing one to be active over the others.

You should have this, too.

	jimm
-- 
Jim Mackraz, I and I Computing	   	"He's hidden now, but you can see
{cbmvax,well,oliveb}!amiga!jimm          The bubbles where he breathes."
							- Shriekback
Opinions are my own.  Comments are not to be taken as Commodore official policy.