setEditable:FALSE not firing? Or am I doing something I shouldn't?
setEditable:FALSE not firing? Or am I doing something I shouldn't?
- Subject: setEditable:FALSE not firing? Or am I doing something I shouldn't?
- From: Graham Wihlidal <email@hidden>
- Date: Wed, 11 Jul 2001 02:43:43 -0600
Hey List,
In order for my text coloring code to function (which it already does),
the NSTextView must be set to Editable. I don't want users just erasing
the chat transcript by just pressing delete, so I hope to setEditable
to YES first (which fires, the disabled NSTextView successfully becomes
Editable), and then after messing around with the colors, I want to
call setEditable:NO to halt further editing. For some reason, it never
disables edit after that? You can still erase parts of the text, move
parts, etc..
Any ideas? This doesn't seem like something I'm doing wrong because
setting it to YES works fine, but it isn't working, so it probably is
me. :)
[SessionWindow_PublicChatField setEditable:YES];
[SessionWindow_PublicChatField
insertText:CFStringCreateWithCString(NULL,NewFormattedChat,
kCFStringEncodingMacRoman)];
TotalLength = [[SessionWindow_PublicChatField textStorage] length];
[SessionWindow_PublicChatField setTextColor:[NSColor blueColor]
range:NSMakeRange(TotalLength - (FirstColorBlockLength +
SecondColorBlockLength),((FirstColorBlockLength +
SecondColorBlockLength) - FirstColorBlockLength) -1)];
[SessionWindow_PublicChatField setTextColor:[NSColor redColor]
range:NSMakeRange(TotalLength - (SecondColorBlockLength + 1),
TotalLength)];
[SessionWindow_PublicChatField setEditable:FALSE];
Thanks in advance,
Graham