Re: "addAttribute:value:range:" error using NSDrawer & NSTextView
Re: "addAttribute:value:range:" error using NSDrawer & NSTextView
- Subject: Re: "addAttribute:value:range:" error using NSDrawer & NSTextView
- From: Charilaos Skiadas <email@hidden>
- Date: Thu, 31 Mar 2005 11:51:56 -0600
On Mar 31, 2005, at 10:19 AM, Pierre Chatel wrote:
Hello,
following my previous post, i ran many investigations in my code and
wrote a little test app. To recap:
I'm having problems when trying to change font attributes to text
contained in a NSTextView. The catch is that this is a mixed
picture/text content since i enabled RTF and image dropping support in
the NSTextView (via interface builder)
To be more precise, i get an "addAttribute:value:range:: nil value"
error. BUT i'm only getting this error if the NSTextView is contained
IN an NSDrawer ! The problem is, i MUST put this text view in a
drawer, not a "normal" panel/window.
So i wrote a very little test application with almost 4 lines of code,
all the wirering is done via interface builder so you can be sure that
i didn't mess with the configuration or the initialization of any of
the objects i'm using.
You can download the binary here: http://www.chatelp.org/test_app.zip
And/Or the source code here: http://www.chatelp.org/test.zip
Please try it, and see the error for yourself:
1) open the drawer
2) write some text and drag a png/giff or any pict u want in the text
3) select the text and use the font panel to change the settings
4)You will get an error in the console and the text content will
become inconsistent
I can confirm this behavior, and add the following:
5) If you select text before and after the image, as well as the image,
and perform a change in the font, it only takes effect on the text
before the image.
6) If you try to delete the image, you run into more trouble.
7) This indeed does not happen if the NSTextView is in the main window.
8) If there is an NSTextView in the main window, then the textview in
the drawer runs fine too.
You can try the exact same thing putting the NSTextView in the main
window and you will NOT get the error !
Is it a "bug" in the NSDrawer implementation ?
It seems to me like a bug. I would suggest filing a report, unless
someone on the list has a better idea.
Thanks,
Pierre
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden