• 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: NSMatrix Subclassed NSScrollView viewable area width?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMatrix Subclassed NSScrollView viewable area width?


  • Subject: Re: NSMatrix Subclassed NSScrollView viewable area width?
  • From: James Andrews <email@hidden>
  • Date: Tue, 18 Jan 2005 21:39:38 -0500

Hi John,

First I have to thank you. Not for the help on this, but on some earlier posts that showed me how to create/manipulate an NSMatrix. (ie the matrix in this problem). Which got me to this point. :-D

Anyway, I tried this and got a ridiculously huge number.

NSLog(@"MatrixWidth: %i",[[self superview] frame].size.width);

Returns: MatrixWidth: 1083023360 which can't be right because IB says the viewable area is 525.

ok. I created an ImageMatrix class which is a subclass of NSMatrix. In interface builder, I created a custom view and gave it a custom class of ImageMatrix. I then highlighted the ImageMatrix custom view representation and did. "Layout" -> "MakeSubClass View" -> "ScrollView".

So It's a subview of 2 classes (I don't know if that means anything).

I'm at a loss, hopefully these ramblings will help describe the situation better.







On Jan 18, 2005, at 9:06 PM, John Pannell wrote:

Hi James-

I've created an NSMatrix subclass, that in IB I have made a subclass
of NSScrollView.

Did you mean your NSMatrix subclass is a sub*view* of NSScrollView? If so, I think I can help. To get the width of the view containing the NSMatrix, you can call

[[self superview] frame].size.width

from any method in your NSMatrix subclass. Due to the mechanics of NSScrollView, the superview of the NSMatrix is actually an instance of NSClipView. More details in the NSScrollView docs...

Hope this helps!

John
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSMatrix Subclassed NSScrollView viewable area width? (From: James Andrews <email@hidden>)
 >Re: NSMatrix Subclassed NSScrollView viewable area width? (From: John Pannell <email@hidden>)

  • Prev by Date: Re: iTunes-like single-click table cell editing
  • Next by Date: Re: AddressBook card view
  • Previous by thread: Re: NSMatrix Subclassed NSScrollView viewable area width?
  • Next by thread: Re: [SOLVED] NSMatrix Subclassed NSScrollView viewable area width?
  • Index(es):
    • Date
    • Thread