• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView with top indent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView with top indent


  • Subject: Re: NSTextView with top indent
  • From: Francisco Tolmasky <email@hidden>
  • Date: Tue, 8 Jun 2004 15:43:10 -0700

That is actually a border around the enclosing NSScrollView, which as I mentioned, I cannot use.

On Jun 8, 2004, at 3:38 PM, Sam McCandlish wrote:

Maybe you didnt use this for a reason, but did you see that on the attributes pane of the Interface Builder inspector, there is a place called "text border"? There are three boxes, one of which is a thin black line.

Sam

On Jun 8, 2004, at 6:15 PM, Francisco Tolmasky wrote:

I'm trying to make a simple one-line text view with a black border
around it. Things are working fine, except for the fact that it
doesn't look so good since the text highlight touches the top border.
So I decided I would just add a little margin around it of 1.0 pixel to
give it a little space. To do this, I used setContainerInset: with an
NSSize of (1.0,1.0). This did push it in 1.0 pixels, BUT
unfortunately, it destroys my black border for some reason. To create
my black border I just do this:


- (void)drawRect:(NSRect)aRect
{
NSRect bounds= [self bounds];

[super drawRect: aRect];

[NSBezierPath strokeLineFromPoint:
NSMakePoint(NSMinX(bounds)+0.5,NSMinY(bounds)) toPoint:
NSMakePoint(NSMinX(bounds)+0.5,NSMaxY(bounds))];
[NSBezierPath strokeLineFromPoint: NSMakePoint(NSMaxX(bounds)-0.5,0.0)
toPoint: NSMakePoint(NSMaxX(bounds)-0.5,NSMaxY(bounds))];
[NSBezierPath strokeLineFromPoint:
NSMakePoint(NSMinX(bounds),NSMinY(bounds)+0.5) toPoint:
NSMakePoint(NSMaxX(bounds),NSMinY(bounds)+0.5)];
[NSBezierPath strokeLineFromPoint:
NSMakePoint(NSMinX(bounds),NSMaxY(bounds)-0.5) toPoint:
NSMakePoint(NSMaxX(bounds),NSMaxY(bounds)-0.5)];
}

For some reason however, adding an inset draws a white line on top of
my top border, thus making only 3/4 of the border show up. The border
drawing MUST be here (it can't be in a surrounding text view) for my
program. Does anyone know how to get around this, or another method of
adding a top margin?

Thank you,

Francisco Tolmasky
email@hidden
http://www-scf.usc.edu/~tolmasky/
_______________________________________________
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.



Francisco Tolmasky
email@hidden
http://www-scf.usc.edu/~tolmasky/
_______________________________________________
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.


  • Follow-Ups:
    • Re: NSTextView with top indent
      • From: Sam McCandlish <email@hidden>
References: 
 >NSTextView with top indent (From: Francisco Tolmasky <email@hidden>)
 >Re: NSTextView with top indent (From: Sam McCandlish <email@hidden>)

  • Prev by Date: Multiple dataSource's for NSTableView?
  • Next by Date: Re: NSTextView with top indent
  • Previous by thread: Re: NSTextView with top indent
  • Next by thread: Re: NSTextView with top indent
  • Index(es):
    • Date
    • Thread