[comp.sys.next] SelectionCell inside a Matrix

garlick@csusac.csus.edu (Jim Garlick) (01/19/90)

I've created a matrix of selectionCells, and set the matrix as
a docView of a scrollView. The problem I'm having is not being able
to set the title of the selectionCells. Here's some code:

[myScrollView setHorizScrollerRequired:YES];
[myScrollView getDocVisibleRect:&aSVRect];
aSVRect.size.height = 1000;  /* need more height for matrix */

protoCell = [SelectionCell newTextCell:"proto"];
myMatrix = [Matrix newFrame:&aSVRect mode:NX_LISTMODE
                   numRows:50 numCols:1];
[myMatrix setScrollable:YES];
[myMatrix setAutodisplay:YES];

[myMatrix setTitle:"first" at:1 :1];
[myMatrix drawCellAt:1 :1];  /* shouldn't need */

[myScrollView setDocView:myMatrix];

Putting in a [myMatrix display] before or after the setDocView doesn't 
seem to have an affect. The scrollVeiw was created in IB. From what I can
get out of the documentation, it seems the first cell here should have the 
word "first" in it, but no. Any suggestions as to what's missing?

Hope this is not inappropriate for this group. Thanks in advance.

Bob Groendyke 
bobgro@csuchico.edu
(I borrowed this account to post. Please send any responses to the group.)

eps@toaster.SFSU.EDU (Eric P. Scott) (01/19/90)

In article <1990Jan18.220642.1067@csusac.csus.edu>
	bobgro@csuchico.edu (Bob Groendyke) writes:
>I've created a matrix of selectionCells, and set the matrix as
>a docView of a scrollView. The problem I'm having is not being able
>to set the title of the selectionCells. Here's some code:

>protoCell = [SelectionCell newTextCell:"proto"];
>myMatrix = [Matrix newFrame:&aSVRect mode:NX_LISTMODE

I think you wanted  prototype:protoCell  here

>                   numRows:50 numCols:1];
>
>[myMatrix setTitle:"first" at:1 :1];
>[myMatrix drawCellAt:1 :1];  /* shouldn't need */

>Putting in a [myMatrix display] before or after the setDocView doesn't 
>seem to have an affect. The scrollVeiw was created in IB. From what I can
>get out of the documentation, it seems the first cell here should have the 
>word "first" in it, but no. Any suggestions as to what's missing?

1) This isn't FORTRAN.  The first cell is 0:0, not 1:1.
2) SelectionCells don't have titles, they have stringValues.
   say  [[myMatrix cellAt:0:0] setStringValue:"first"];
				(or setStringValueNoCopy:"first")
   Note that Matrix doesn't implement setStringValue:at:, only
   Form does, and Forms can only have one column, so there's no
   setStringValue:at::, hence the use of cellAt::.

					-=EPS=-