WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Gorm: Editing a TextField - multiline support?

Re: Gorm: Editing a TextField - multiline support?

by David Chisnall :: Rate this Message:

| View in Thread

On 6 May 2012, at 09:38, Csanyi Pal wrote:

>> NSTextField is designed to enter short text which (usually) fits on a
>> line. If you want multi-line input you should be using a NSTextView
>> instead.
>
> Actually what I want is a multiline output for Help text that should be
> shown to the user. How can I achieve this goal?

As Wolfgang said, use an NSTextView.  You can set it to non-editable if you just want to display text.

NSTextField is a slightly ugly hack left over from when a high-end workstation had 8MB of RAM and having a few KB of state for every text field in a window would have made you run out of memory quickly.  All text fields share a text view (technically, some NSText subclass, but in practice typically an NSTextView) that they each use for drawing and editing one at a time.  When you select an NSTextField[Cell], it acquires temporary ownership of this instance (the field editor) and uses it to draw and handle events.  

This is most important when you have something like an NSTableView with an NSTextFieldCell in every row or a very large form in an NSScrollView.  You could quickly run out of memory on an older machine if every single one of these was a separate NSTextView.

For large amounts of text, you should just use an NSTextView directly.

David

-- Sent from my IBM 1620


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@...
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

 « Return to Thread: Gorm: Editing a TextField - multiline support?