[comp.sys.amiga] Window to front

dennya@pnet02.gryphon.com (Denny Atkin) (09/11/89)

Hi.  A friend of mine is trying to duplicate the Amiga j/k window shuffling
in MachII.  (MachII.5).  Basically, Amiga-J sends the rearmost window on
the screen to the front and makes it active, while Amiga-K sends the frontmost
windo to the back and makes thone behind it active.

Problem is, he can't find any structures in intuition which say which window
is at the front, only which window is active. He's using M2Sprint.  Any
ideas?
--------
 Denny Atkin, Assistant Editor, Compute! Magazine    | Disclaimer:  my own
 People/Link: DENNY  BIX: dennya  CI$: no way        | biased opinions. 
 UUCP:{ames!elroy, <backbone>}!gryphon!pnet02!dennya | "It is. But it is
 INET:dennya@pnet02.gryphon.com                      | not."  

joe@cbmvax.UUCP (Joe O'Hara - QA) (09/11/89)

In article <19716@gryphon.COM> dennya@pnet02.gryphon.com (Denny Atkin) writes:
>Problem is, he can't find any structures in intuition which say which window
>is at the front, only which window is active. He's using M2Sprint.  Any
>ideas?

He can get what he needs from layers info:

#define MY_SCREEN   MyWindow->WScreen
#define MY_LAYER    MyWindow->WLayer

if (MY_LAYER != MY_SCREEN->LayerInfo.top_layer) WindowToFront(MyWindow);

-- 
========================================================================
  Joe O'Hara                ||  Comments represent my own opinions,
  Commodore Electronics Ltd ||  not my employers. Any similarity to
  Software QA               ||  to any other opinions, living or dead,
                            ||  is purely coincidental.
========================================================================

cmcmanis%pepper@Sun.COM (Chuck McManis) (09/13/89)

In article <19716@gryphon.COM> dennya@pnet02.gryphon.com (Denny Atkin) writes:
>Problem is, he can't find any structures in intuition which say which window
>is at the front, only which window is active. He's using M2Sprint.  Any
>ideas?

From intuitionbase.h :

struct IntuitionBase
/* IntuitionBase should never be directly modified by programs  */
/* even a little bit, guys/gals; do you hear me?        */
{
    struct Library LibNode;

    struct View ViewLord;

    struct Window *ActiveWindow;
    struct Screen *ActiveScreen;

    /* the FirstScreen variable points to the frontmost Screen.  Screens are
     * then maintained in a front to back order using Screen.NextScreen
     */
    struct Screen *FirstScreen; /* for linked list of all screens */

	...

It goes on, just don't use those pieces that are "private". 
So how hard did this person look ? :-)


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"If I were driving a Macintosh, I'd have to stop before I could turn the wheel."