• 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 LineNumber
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView and LineNumber


  • Subject: Re: NSTextView and LineNumber
  • From: Jonathan Jackel <email@hidden>
  • Date: Sun, 16 Nov 2003 17:58:23 -0500

You want:

[[textView textStorage] addAttributes:dict range:myRange];

It's "addAttributes", not "setAttributes".

You also want to make sure you are sending this message to an instance
of a text view class. You are sending the message to "MyNSTextView".
Usually you would capitalize class names and lowercase instance
variables. A lot of people seem to be ignoring this particular
convention, however.

Jonathan

On Nov 16, 2003, at 4:59 PM, Wezzy wrote:

> Hi all, i have 2 simple question :
> 1) how can i display line numbers on the right of my NSTextView
> subclass ?
> 2) how can i change the background color of a specific line ?
> (something like the debugger of Xcode) i've got the range and i've
> tried with
> dict = [[NSDictionary alloc] initWithObjectsAndKeys:[NSColor
> redColor],@"NSBackgroundColorAttributeName",nil];
>
> [[MyNSTextView textStorage] setAttributes:dict range:myRange];
>
> but it doesn't work.
>
> Thanks a lot for your time
> Wezzy _______________________________________________
> 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: 
 >NSTextView and LineNumber (From: Wezzy <email@hidden>)

  • Prev by Date: NSTextView and LineNumber
  • Next by Date: SearchKit Performance
  • Previous by thread: NSTextView and LineNumber
  • Next by thread: SearchKit Performance
  • Index(es):
    • Date
    • Thread