[comp.sys.next] Novice AppKit/IB question about Wait Cursors

eps@toaster.SFSU.EDU (Eric P. Scott) (12/21/89)

I want to make a window with a "next" button; you click the
button, and the window is replaced on the screen by a previously
unseen window.  The transition is one-way.

 window1        window2
+--------+ +---------------+
|        | | other       ^ |
| BUTTON | |  stuff      | | (instantiated in IB)
+----|---+ +-------------|-+
     |                   |
     |  (custom object)  |
     |  outlet transitTo-/
     \->action transit:

So I say

- transit:sender
{
    [[sender window] close];
    [transitTo makeKeyAndOrderFront:sender];
    return self;
}

The thing is, window2 is pretty complicated, and it takes a
noticeable amount of time to appear.  Looks like a good place for
a wait cursor.  So I bracket the transition, and a wait cursor
flashes for an instant, then reverts to an arrow well before the
second window appears.  Then I try putting in an NXPing(); but
this doesn't seem to change anything.  The method now looks like:

- transit:sender
{
    [NXWait push];
    [[sender window] close];
    [transitTo makeKeyAndOrderFront:sender];
    NXPing();
    [NXWait pop];
    return self;
}

I tried putting [transitTo flushWindow] before the NXPing(); and
that didn't do it either.  How do I keep the wait cursor up until
the second window is flushed?  Do I have to hack this into a
windowDidBecomeKey delegate method?  (Will that even work?)

I'm sure I'm missing something obvious.

					-=EPS=-

dennisg@kgw2.uucp.WEC.COM (Dennis Glatting) (12/21/89)

you should have: {{ NXWait ] push ] set ];

--
 dennisg@kgw2.UUCP.WEC.COM  | Dennis P. Glatting
 tron!kgw2!dennisg          |
   I want my own NeXT, 64 MB RAM, 660 MB SCSI, NeXT Printer, color.
   ** Accepting Donations **

eps@toaster.SFSU.EDU (Eric P. Scott) (12/23/89)

In article <326@kgw2.uucp.WEC.COM> dennisg@kgw2.uucp.WEC.COM
	(Dennis Glatting) writes:
>you should have: {{ NXWait ] push ] set ];

I think you meant [[NXWait push] set]; sorry, that doesn't work.
The cursor still reverts to an arrow.  (BTW, your "solution" runs
counter to the documentation, but I tried it anyway.)

If it's not clear what I'm trying to do, watch the Workspace
cursor when you go from View>Icon to View>Browser.  That's the
behavior I'm looking for.

					-=EPS=-

eps@toaster.SFSU.EDU (Eric P. Scott) (12/24/89)

I got two pieces of e-mail insisting that [NXWait push] ...
[NXWait pop] "works for them."  Well, it didn't work for me...
until I tried ordering the main window out first.  I smell a bug.


- transit:sender
{
    [[sender window] orderOut:sender]; // Why do I have to do this?
    [NXWait push];
    [[sender window] close];
    [transitTo makeKeyAndOrderFront:sender];
    NXPing();
    [NXWait pop];
    return self;
}

					-=EPS=-