• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multi-Column NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi-Column NSTextField


  • Subject: Multi-Column NSTextField
  • From: email@hidden
  • Date: Fri, 18 Oct 2002 13:18:02 EDT

Two questions about using Cocoa's Text System (NSText, NSTextStorage,
NSTextContainers, NSLayoutManager) with regard to a multi-columns
application. Assume that I am writing an application that displays
multipage's of text, and allows users to switch between 1 to 3 columns where
the text flows from one column to another, one page to another.

When user selects one column, the application can create one Text Container &
one Text Field to display the information. The column would be as wide as a
printable width of page, while the length would be what is needed to display
entire text (regardless of how long the printable page is). When the user
prints, the print engine will break the large display area up into separate
print pages.

However, when user selects 2 or more columns, the program has to create
multiple Text Container/Text Field pairs, to fill up each page. For example,
if user selects 3 column style of page, and there is enough text for 8
columns, the program needs to calculate and create 8 Text Containers/Text
fields (each the height of the printable area of the page). First the program
would create three columns, side by side, then move down to bottom of first
column, and create 3 more columns, and then move down for last two columns.
This way the page would be split correctly when displayed and printed out
with page break.

Does this sounds correct? Or is there a simplier way?

Second question, when working with more than 1 column, I have to first create
a Container/Field pair that are the width of the column size I want, then
fill the text into it and resized it! I need this resized information to know
how much height is need to display the text over multiple containers for a
given width.

Does this sound correct? Or is there a simplier way?

All comments are appreciated!

Steve Sheets
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Multi-Column NSTextField
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: extended chars in paths, bug or other way to do it?
  • Next by Date: Re: Guidance needed: IrDa
  • Previous by thread: extended chars in paths, bug or other way to do it?
  • Next by thread: Re: Multi-Column NSTextField
  • Index(es):
    • Date
    • Thread