• 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
Flipping within a cell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Flipping within a cell?


  • Subject: Flipping within a cell?
  • From: Stephane Sudre <email@hidden>
  • Date: Fri, 21 Oct 2005 12:39:02 +0200

I have subclasses of NSButton and NSButtonCell used for a custom theme (in fact to work around the lack of a theme in the AppKit on 10.2).

The NSButton subclass is returning NO for isFlipped (NSButton is returning YES) because I need to use some drawing methods which are not supporting flipping correctly.

The NSButtonCell subclass overrides the standard drawWithFrame:inView: method to draw the appropriate background and then calls the super implementation of drawInteriorWithFrame:inView:.

Since the flip flag is not what it usually is, the super method has some troubles drawing the interior at the correct location (on 10.4 mainly).


I tend to believe it might be possible to work around this by modifying the transformation matrix but it seems either there's a bug in NSAffineTransform or I'm missing something.


I tried to concat a NSAffineTransform which is built from the identity matrix , then scaled by -1 on the Y axis and 1 on the X axis and finally translated by the Height of the cell on the Y axis.

But this does not work. It looks like NSAffineTransform does not support negative scaling.

Using positive scaling gives the appropriate results but this is not really helpful.

I looked at the NSView code in GNUstep but it was not really helpful to see how this whole flip thing is working internally.

Any clue?

_______________________________________________
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


  • Prev by Date: Re: NSTableView, variable row heights, small fonts
  • Next by Date: OT: Cocoa or Carbon?
  • Previous by thread: Re: Multi-threaded opengl or view access crashes system?
  • Next by thread: OT: Cocoa or Carbon?
  • Index(es):
    • Date
    • Thread