The R Project SVN R-packages

Rev

Rev 1254 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1254 Rev 1490
Line 81... Line 81...
81
- (void) insertText: (NSString*) text atIndex: (int) index withColor: (NSColor*) color
81
- (void) insertText: (NSString*) text atIndex: (int) index withColor: (NSColor*) color
82
{
82
{
83
	//NSLog(@"insert %d chars at %d to result in %d length", [text length], index, [cont length]+[text length]);
83
	//NSLog(@"insert %d chars at %d to result in %d length", [text length], index, [cont length]+[text length]);
84
	[cont replaceCharactersInRange: NSMakeRange(index,0) withString: text];
84
	[cont replaceCharactersInRange: NSMakeRange(index,0) withString: text];
85
	[cont addAttribute:@"NSColor" value:color range: NSMakeRange(index, [text length])];
85
	[cont addAttribute:@"NSColor" value:color range: NSMakeRange(index, [text length])];
86
	[cont addAttribute:@"NSFont" value:[[RController getRController] currentFont] range: NSMakeRange(index, [text length])];
86
	[cont addAttribute:@"NSFont" value:[[RController sharedController] currentFont] range: NSMakeRange(index, [text length])];
87
	[self edited:NSTextStorageEditedCharacters|NSTextStorageEditedAttributes range: NSMakeRange(index,0) changeInLength:[text length]];
87
	[self edited:NSTextStorageEditedCharacters|NSTextStorageEditedAttributes range: NSMakeRange(index,0) changeInLength:[text length]];
88
}
88
}
89
 
89
 
90
@end
90
@end