• 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: NSTextView and Line Numbering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView and Line Numbering


  • Subject: Re: NSTextView and Line Numbering
  • From: Koen van der Drift <email@hidden>
  • Date: Sun, 23 Feb 2003 12:54:49 -0500

At 10:25 AM -0500 2/23/03, James Derry wrote:

>I am having a little bit of difficulty with the pasting text into the
>TextView with the line numbers displayed. Do you get strange behavior?

No - I have no problems. One thing I added later is a force redraw of the
linenumbers when a sheet comes up. I used the windowDidUpdate notification
for this.


If I
>step through lineFragmentRectForProposedRect:, it always properly returns
>the correct corrected rectangle, but I get two types of misbehavior: (1) if
>I paste in multiple lines, all of the text appears shifted to the left UNDER
>the "left margin" area. If I paste in a single line, it appears okay, but
>further lines have the insertion point shifted to the right by the "left
>margin" distance -- but when typed is inserted into the correct spot.

Are you sure that you added myViewContainer to myTextView? In
myWindowController awakeFromNib I call:

contentSize = [scrollView contentSize];
frame = NSMakeRect(0, 0, contentSize.width, contentSize.height);
myContainer = [[MyViewContainer allocWithZone:[self zone]]
initWithContainerSize:NSMakeSize(frame.size.width, 100000)];

[myContainer setWidthTracksTextView:YES];
[myContainer setHeightTracksTextView:NO];

myTextView = [[MyTextView alloc] initWithFrame:frame];
[myTextView replaceTextContainer:myContainer];

[myContainer release];




hth,

- Koen.
_______________________________________________
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: NSTextView and Line Numbering
      • From: James Derry <email@hidden>
References: 
 >Re: NSTextView and Line Numbering (From: James Derry <email@hidden>)

  • Prev by Date: Re: NSStatusBar limit?
  • Next by Date: Re: Dumb question regarding IB palettes..
  • Previous by thread: Re: NSTextView and Line Numbering
  • Next by thread: Re: NSTextView and Line Numbering
  • Index(es):
    • Date
    • Thread