• 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: 3 AppKit Qs: NSImageView; NSButton colours; NSMatrix "flip"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3 AppKit Qs: NSImageView; NSButton colours; NSMatrix "flip"


  • Subject: Re: 3 AppKit Qs: NSImageView; NSButton colours; NSMatrix "flip"
  • From: Brian Webster <email@hidden>
  • Date: Fri, 21 Feb 2003 09:05:40 -0600

On Friday, February 21, 2003, at 08:26 AM, email@hidden wrote:

1. NSImageView rotation.
Setting view bounds rotation seems to work for text and bezier paths, but
NSImageView always draws horizontally regardless of rotation settings. Some
displacement and some severe border-drawing glitches are the only result of
changing the rotation settings. How can I rotate a picture?

My guess is that NSImageView is using one of the compositeToPoint: methods of NSImage, which don't respect coordinate transformations when drawing. There are newer methods, the drawToPoint: methods which do respect these transformations. Don't know if there's any way to coerce NSImageView to do what you want, but you should be able to do it by subclassing NSView and drawing the image yourself.

2. NSButton gradient colours.
Is there any way to adjust the gradient colour of NSButton/NSButtonCell from
the grayish default? Would attaching a coloured icon or pict overlay work?

You might be able to use setControlTint: to make it blue, but there's no way to apply an arbitrary color to a button.

3. NSMatrix "flipped"?
Strange that NSMatrix cells start with (0,0) at the upper-left, and ditto for
cell frame coordinates? Aren't AppKit views supposed to have (0,0) at the lower
left? Is "flipping" this view back to bottom-left origin advisable?

Having the origin at the lower left is the default, but plenty of views are "flipped", meaning they override the isFlipped method to return YES and thus have their origins at the upper left. Text views are flipped by default, since they do their drawing from the upper left and it makes it much easier to calculate coordinates that way. I don't think the actual coordinate system for NSMatrix is flipped (can't remember for sure), but the cell numbering scheme might be that way to keep it consistent with the way matrices are usually dealt with in mathematics, counting rows and columns from the top left.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.

  • Prev by Date: Re: 3 IB Qs: actions; view tags; NSWindow setFrame
  • Next by Date: Re: 3 IB Qs: actions; view tags; NSWindow setFrame
  • Previous by thread: 3 AppKit Qs: NSImageView; NSButton colours; NSMatrix "flip"
  • Next by thread: 3 IB Qs: actions; view tags; NSWindow setFrame
  • Index(es):
    • Date
    • Thread