Re: NSTextView and LineNumber
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.