ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/Aug/Matrix:-why-homogeneous-size?

This is Matrix:-why-homogeneous-size? in view mode; [Up]


Date: Sun 29-Aug-1989 02:55:48 From: Unknown Subject: Matrix: why homogeneous size? >From class description of Matrix (SysRefMan 21-1): The Matrix Class allows creation of matrices of cells of the same or of different type. The main restriction is that all cells must have the same size. Ugh... I could see a conceptual reason (or, at least, an excuse) for this restriction if the cells had to be of the same type. But I think a much more reasonable matrix class would be one where each row and each column could be of different size, if necessary. In other words, the restriction should only be "that the width of all cells in any given column must be the same, and the height of all cells in any given row must be the same". I need such a class for displaying and editing a table. Actually, in my case, I can live with the restriction that all rows are the same height, but not with having all columns be of the same width. Is there a recommended way of doing this? (I heard that somebody is working on a spreadsheet... they aren't going to restrict all columns to the same width, are they?) Will Matrix in 1.0 still have the current homogeneous-size restriction? Does anybody have a more general matrix class they can share (or at least give some advice on creating one)? Jacob
Date: Sun 31-Aug-1989 15:05:33 From: Unknown Subject: Re: Matrix: why homogeneous size? In article <130014@gore.com> jacob@gore.com (Jacob Gore) writes: >From class description of Matrix (SysRefMan 21-1): > The Matrix Class allows creation of matrices of cells of the same > or of different type. The main restriction is that all cells must > have the same size. >Ugh... I could see a conceptual reason (or, at least, an excuse) for this >restriction if the cells had to be of the same type. But I think a much >more reasonable matrix class would be one where each row and each column >could be of different size, if necessary. In other words, the restriction >should only be "that the width of all cells in any given column must be the >same, and the height of all cells in any given row must be the same". Looks like the Matrix class is not the way to go; it doesn't seem to be possible to subclass Matrix to get the behaviour you want. At least not easily. The above restriction is indeed true --- the Matrix class is supposed provide an efficient way to collect many controls together, and one of the tradeoffs is the requirement that all cells be the same size. This is a design decision that will remain true in 1.0. If you want table behaviour, with different width columns, then you might get away with using a number of matrices, and maybe creating a class to manage such a "Table" structure. Of course, you will lose the tracking feature (between columns), and such a class will be less efficient than using just a single matrix. (Might not be a problem for fixed sized tables with a small number of columns.) Ali Ozer, NeXT Developer Support aozer@NeXT.com >From: dz@pumpkin.ucsb.edu (Daniel James Zerkle)

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.