• 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: Subclass of TextView in ScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclass of TextView in ScrollView


  • Subject: Re: Subclass of TextView in ScrollView
  • From: Michael Peirce <email@hidden>
  • Date: Thu, 13 Dec 2001 17:32:35 -0500

On Thursday, December 13, 2001, at 02:13 PM, Gerriet M. Denkmann wrote:

I have an document based app with a window with a ScrollView with a TextView.

But now I would like to have a subclass MyTextView inside the ScrollView.

Is there a way to do this inside IB?
Or do I have to replace the TextView with MyTextView progrmmatically (e.g. in windowControllerDidLoadNib:) ?

With IB viewing your ___.nib window click on the "Classes" tab. Then navigate to the NSTextView item and select it.

Look up in the "Classes" menu and you should see the first item called "Subclass NSTextView". It will create one called MyTextView (you can change the name by double clicking on the text).

This subclass will have the same Actions and Outlets that NSTextView has, and you can add your own.

Now drag out a CustomView and in it's Attributes info panel you can select your MyTextView there to set it as the class for that view.

When the nib is used in your program, your custom view will be of type MyTextView.


Oh, I see you were asking about using MyTextView inside a scroll view. It seems like you should be able to select the NSTextView (by doubclicking after dragging out a NSTextView embedded in an NSScrollView from the palette) and view the "Custom Class" in the info panel, but it says "Not Applicable" in this case.

That's odd since when I click on, say, an NSImage UI element, I get a list of all the NSImage subclasses I've created and can select one of them for this UI element.

Even for other views embedded in an NSScroller - I tried this on an NSOutline view in a NSScroller I dragged over from the palette and it works as I'd expect.

Is this a bug?

--
Michael Peirce
6497 Spinnaker Drive
Lewis Center OH 43035
740-657-1269
email@hidden


  • Follow-Ups:
    • Re: Subclass of TextView in ScrollView
      • From: Vince DeMarco <email@hidden>
References: 
 >Subclass of TextView in ScrollView (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Newbie questions about preferences
  • Next by Date: Re: Newbie questions about preferences
  • Previous by thread: Subclass of TextView in ScrollView
  • Next by thread: Re: Subclass of TextView in ScrollView
  • Index(es):
    • Date
    • Thread