• 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: NSScrollView / NSTextView questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScrollView / NSTextView questions


  • Subject: Re: NSScrollView / NSTextView questions
  • From: Matt Jaffa <email@hidden>
  • Date: Mon, 19 Apr 2004 13:19:41 -0600

Hi,

awhile back someone posted an example of doing this , his own designed app,
if you are interested i can send you the app.

Matt


On Apr 19, 2004, at 12:55 PM, Josh Black wrote:

Hi -

I'm fairly new to Cocoa and am trying to write a simple programmer's
text editor. My biggest challenge so far has been line numbering. I
have the algorithm for generating the line numbers, but my challenge
has been finding a way to display those line numbers and have them
scroll alongside the text in the NSTextView. I want to end up with a
nice clean look, similar to the one in SubEthaEdit.

I looked at the document nib file for SubEthaEdit and I can see that
they have a NSScrollView for the entire editing region. How does one
achieve the kind of line numbering effect that they have? Do I need to
create a custom view that has a NSTextField for the line numbers and
place that next to the NSTextView, then make that custom view the
document view of the NSScrollView? Or is there a better way to do
this? Can I create a nice clean separation like they have using only
the NSTextView? I've seen a few line numbering implementations that
draw the line numbers inside the NSTextView itself, but there was no
separation. The numbers appeared next to the text with a small gap,
but (IMHO) it looks a bit sloppy without a nice column to put the line
numbers in.

Any suggestions and/or code would be greatly appreciated. Thanks!

Josh
_______________________________________________
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.
_______________________________________________
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.


References: 
 >NSScrollView / NSTextView questions (From: Josh Black <email@hidden>)

  • Prev by Date: Re: sheet weirdness
  • Next by Date: Re: NSWindow display?
  • Previous by thread: Re: NSScrollView / NSTextView questions
  • Next by thread: Re: NSScrollView / NSTextView questions
  • Index(es):
    • Date
    • Thread