Path: utzoo!utgpu!watmath!iuvax!purdue!gatech!prism!roy
From: roy@prism.gatech.EDU (Roy Mongiovi)
Newsgroups: comp.sys.next
Subject: Why is the application kit so frustrating?
Message-ID: <1520@hydra.gatech.EDU>
Date: 17 Aug 89 18:48:00 GMT
Organization: Georgia Institute of Technology
Lines: 67

I am having an incredibly frustrating time trying to figure out what messages
to send to what objects to get my interface to behave the way I want it to.
Is this all because of the lack of documentation, is it bugs in the application
kit, or is it a deficiency in the object definitions themselves?

I've got a copy of the 0.9 technical references, but I find I still have to
basically try every combination of possibly applicable methods and objects to
get the interface to behave in the desired fashion.  I can't tell you how tired
I get of "well, let's see.  I can invoke this method of the matrix, or this
method of the cell of the matrix, or maybe it should be this method...."

I've got this setup panel that contains a matrix of 4 textfieldcells.  My
customview object has the id of the matrix.  I've got a menu item that wants
to be able to reset the values of all 4 numbers in the matrix.

I was resetting the cells with statements like:

    [[matrixobj cellAt: 0: 0] setDoubleValue: value];

If none of the cells in the matrix are selected, clicking the reset menu item
does reset all the values in the matrix, and they are displayed.  However, if
one of the textfieldcells is selected, all the values in the matrix get reset,
but the cell containing the cursor does not get redisplayed so you can't tell
that it's been reset.  Also, it had the following wierd behaviour that when I
hit the tab key to go to the next entry in the matrix, the cell I had been in
would be cleared, and then when I hit tab again the correct value would appear
in the cleared cell, and the cell I had just been in would then clear.  Very
strange.

Sending the matrix a display message does not fix the problem.

Neither of the statements:

    [matrixobj clearSelectedCell];	and
    [matrixobj selectCellAt: -1: -1];

clears the selection, and the selectCellAt method does not end editing (even
though that is one of its documented effects).

In the many incantations that I tried, I managed to get white rectangles to
appear at odd places in the window (i.e. not in the textfieldcell where they
ought to be).  I managed to get it confused so that multiple cells were
highlighted (as though they were selected) although only the one containing
the cursor really was selected.

I finally fixed the code when I came across a note under one of the method
descriptions in the technical reference manual.  The correct incantation
seems to be:

    [matrixobj displayCell: [[matrixobj cellAt: 0: 0] setDoubleValue: value]];

I still can't figure out how to deselect the selected cell, though.

All-in-all, I spent several hours trying various combinations of things in
order to get this piddly little piece of my interface to behave in the correct
manner.

Is this the way it's supposed to be?

On another note, can anyone tell me why double clicking a window's close button
makes the application hide?  Try opening an info panel and double clicking it
closed.
-- 
Roy J. Mongiovi     Systems Support Specialist     Office of Computing Services
Georgia Institute of Technology	  Atlanta, Georgia  30332-0275   (404) 894-4660
	uucp: ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!roy
	ARPA: roy@prism.gatech.edu