[comp.sys.apple] Window close box question

nala@ihlpl.ATT.COM (A. Flora-Holmquist) (07/25/88)

Greetings fellow IIgs programmers:

I am writing my first desktop program that utilizes windows and the
taskmaster. I can create windows just fine in response to selected menu
items. However, when clicking the window close box, the window
does not close, although the close box is highlighted when clicked.
Reading the taskmaster pseudocode in the toolbox ref I thought the 
window close routines are called when the close box is called. 
Did I misunderstand the taskmaster psuedocode that deals with the close 
box? Would someone give me a helpful hint. I will continue to read the 
references I know the info is in there somewhere.

Thanks,

Al Flora-Holmquist
ihnp4!ihlpl!nala

prw@meccsd.MECC.MN.ORG (Paul R. Wenker) (07/26/88)

In article <5970@ihlpl.ATT.COM> nala@ihlpl.ATT.COM (A. Flora-Holmquist) writes:
>...However, when clicking the window close box, the window
>does not close, although the close box is highlighted when clicked....


Since there may be some cleanup associated with closing a window (i.e.
closing a file, disposing of memory) that is specific to each
application, TaskMaster just returns a 'wInGoAway' code when the user
clicks in the close box.  The 'wmTaskData' field of the event record
will contain a pointer to the window that needs to be closed.  If the
window is one of your own, just do whatever cleanup is necessary and
then call CloseWindow.  If the window is not yours, just pass the
window pointer to CloseNDAbyWinPtr.


Paul R. Wenker			prw@meccsd
MECC, Technical Services

keith@Apple.COM (Keith Rollin) (07/26/88)

In article <5970@ihlpl.ATT.COM> nala@ihlpl.ATT.COM (A. Flora-Holmquist) writes:
>items. However, when clicking the window close box, the window
>does not close, although the close box is highlighted when clicked.
>Reading the taskmaster pseudocode in the toolbox ref I thought the 
>window close routines are called when the close box is called. 

TaskMaster calls TrackgoAway. It does NOT close the window. It will return the
message 'wInGoAway', in response to which you should call CloseWindow or
HideWindow.



Keith Rollin                                               amdahl\
Developer Technical Support                           pyramid!sun !apple!keith
Apple Computer                                             decwrl/
"You can do what you want to me, but leave my computer alone!"

JWANKERL@UTCVM.BITNET (Josef Wankerl) (08/02/88)

Al,

I think I know what your problem is.
If you can close your window using the close item from the File menu
and you can't using the close box on the window, then the following
MIGHT be your problem:

You have not told TaksMaster what to do when you click in the
close box.  I believe the table item is called 'in goaway' or
something like that.  Set the 'in goaway' item in the TaskMaster
event lookup table to be the entry to your close routine that you
call from the File menu and your problem should be solved.

-Gonzo

p.s.  That might not be your problem, but it is one that I had
      for a few days.

STEIN@UCONNVM.BITNET (Alan Stein) (08/07/88)

What TaskMaster does with the window may depend on the event mask you
sent to the stack before calling it.

ARPA:   stein%uconnvm.bitnet@mitvma.mit.edu        Alan H. Stein
BITNET: STEIN@UCONNVM                          University of Connecticut
UUCP:   ...ihnp4!psuvax1!UCONNVM.BITNET!STEIN        at Waterbury
CompuServe: 71545,1500  Genie:  ah.stein       Department of Mathematics