NSBoxSeparator in NSTextField
NSBoxSeparator in NSTextField
- Subject: NSBoxSeparator in NSTextField
- From: Craig Bakalian <email@hidden>
- Date: Mon, 5 Jul 2004 05:53:31 -0400
Hi,
I am trying to add a NSBox as a NSBoxSeparator in a NSTextField. I do
understand how to do this programmatically via NSFIleWrapper, yet I
don't want to write a file. So, I thought the code below would work,
yet it ain't ->
-(void)drawSeparator: (Plan *)p
{
NSRect r = NSMakeRect(0,0,[activeLesson frame].size.width, 4);
NSBox *separator = [[NSBox alloc] initWithFrame: r ];
[separator setBoxType: NSBoxSeparator];
NSRange range = NSMakeRange([p headerRange].length, 0);
[activeLesson replaceCharactersInRange: range withRTFD: [separator
dataWithPDFInsideRect: r]];
BOOL working;
working = [[activeLesson textStorage] containsAttachments];
[separator release];
}
The [p headerRange].length returns the character length of the
attributed string in the NSTextField, and then I want to insert the
separator below. Any thoughts as to how to do this will be
appreciated.
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
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.