• 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: Custom border (repeated image) for NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom border (repeated image) for NSTextView


  • Subject: Re: Custom border (repeated image) for NSTextView
  • From: Nick <email@hidden>
  • Date: Sun, 25 Sep 2011 23:46:13 +0300

thank you, I just did it this way and it works great

2011/9/25 Quincey Morris <email@hidden>

> On Sep 25, 2011, at 04:48 , Nick wrote:
>
> I need to create a custom border for the textview. This border should be
> made out of an image.
> I subclassed NSScrollView (since i need the border to surround scroll bars
> as well as the text area) and rewrote the -drawRect method.
> At the end of this method I am calling [super drawRect:dirtyRect] to get
> the
> original textview with its scrollbars.
> The problem is that I do not know how to tell the control (text view +
> scroll view) to draw in an "smaller area" - so the original view and
> scrollbars are not being drawn on top of my border (thus overriding it),
> but
> instead draw them as a slightly scaled down image. How could I do that?
>
>
> It would be a lot easier to make the scroll view smaller, embed it in a
> custom view with the scroll view's original size, and draw the custom border
> in the custom view. (You can turn off the scroll view's standard border and
> background, if necessary, and draw those in the custom view instead.)
>
> If you *must* do it by subclassing NSScrollView, then you can override
> -[NSScrollView tile] to rearrange the pieces, but it's going to be a lot of
> work to mimic the standard layout rules in all cases.
>
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Custom border (repeated image) for NSTextView (From: Nick <email@hidden>)
 >Re: Custom border (repeated image) for NSTextView (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: How do you enable a view controller to be instantiated programmatically or from a XIB?
  • Next by Date: How to open all the documents from the previous "session"?
  • Previous by thread: Re: Custom border (repeated image) for NSTextView
  • Next by thread: How to open all the documents from the previous "session"?
  • Index(es):
    • Date
    • Thread