Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newlines in table cells

1 view
Skip to first unread message

Lee Christensen

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to
The existing 'draw-cell-contents seems to remove newlines from displayed
strings, as well as truncate the string and add ellipses if it is too
long. I would like to display a table with strings that might contain
newlines. For instance, in the following example I would like the table
to look like this:

hello nihauma
goodbye zaijian

Rather than like this:

hellogoodbye nihaumazaiji...

(let* ((window (MAKE-INSTANCE
'COLOR-DIALOG
:WINDOW-TYPE
:DOCUMENT-WITH-GROW
:VIEW-POSITION
'(:LEFT 37)
:VIEW-SIZE
#@(656 563)
:VIEW-FONT
'("Charcoal" 12 :SRCOR :PLAIN (:COLOR-INDEX 0))
:VIEW-SUBVIEWS
(LIST (MAKE-DIALOG-ITEM
'MY-TABLE-DIALOG-ITEM
#@(7 7)
#@(639 509)
""
'NIL
:VIEW-NICK-NAME 'my-table
:CELL-SIZE #@(300 48)
:SELECTION-TYPE
:CONTIGUOUS
:TABLE-HSCROLLP T
:TABLE-VSCROLLP T
:ROWS 2
:COLUMNS 2
:TRACK-THUMB-P NIL
:SEPARATOR-COLOR 8421504
:table-print-function #'write-string
:SEPARATOR-PATTERN '*BLACK-PATTERN*
:SEPARATOR-SIZE #@(0 0)))))
(array (make-array `(2 1)
:initial-contents
`((,(format nil "hello~%goodbye"))
(,(format nil
"nihaoma~%zaijian"))))))
(ccl::set-table-array (view-named 'my-table window) array)
(view-draw-contents (view-named 'my-table window)))


I fiddled around a bit with the 'table-print-function, and with
shadowed versions of 'draw-cell-contents, but I have not been
successful. I am not a "real" die-hard Mac or MCL programmer, and I am
wondering if there is any simple solution to my quest, or any sample
code that anyone would not mind sharing.

Thanks all,

Lee Christensen


The quality of mercy is not sprained...

0 new messages