• 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
Re: Tab-stop filled with dots?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tab-stop filled with dots?


  • Subject: Re: Tab-stop filled with dots?
  • From: Brian Webster <email@hidden>
  • Date: Sat, 26 Apr 2003 20:13:36 -0500

I think overriding drawRect: might work, but if you're looking for the "correct" place to actually perform custom drawing for text, I believe the method you'd want is -[NSLayoutManager drawGlyphsForGlyphRange:atPoint:]. However, to use your own subclass of NSLayoutManager, I believe you would have to construct your text system hierarchy by hand instead of dragging the default text view widget in Interface Builder. There would also be some machinations in order to translate the given glyph range to a character range, find which characters are tabs, and then fill those glyphs' bounding boxes with dots. Take a good look at the "Text System Architecture" programming topic in the Cocoa docs to learn more about how to customize text display.

On Friday, April 25, 2003, at 02:01 PM, email@hidden wrote:

anyone knows how to fill a tab-stop with dots the way you know from programs like word or quark? You can see doted tab-stops in the contents page of nearly every book. The page numbers are right aligned and the space between the last character and the page number is filled up with dots.

I can imagine a workaround and belief this is not the correct way: it follows the way Apples CircleView takes:
In drawRect search the character range of the page being drawn for tab-stops. Get the bounding rectangle of all continuous tabs in a line an over paint it with dots. But how to hangle this correctly with apples text system?
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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: Tab-stop filled with dots?
      • From: Uko Fiedler <email@hidden>
  • Prev by Date: Re: NSThread as a wrapper
  • Next by Date: deleting a tableColumn...
  • Previous by thread: Tab-stop filled with dots?
  • Next by thread: Re: Tab-stop filled with dots?
  • Index(es):
    • Date
    • Thread