Core Animation and NSImageView
Core Animation and NSImageView
- Subject: Core Animation and NSImageView
- From: "Mário Freitas" <email@hidden>
- Date: Thu, 24 Jan 2008 02:29:46 +0000
Hi there,I have a problem with an application when I enable Core Animation.
Basically, I have a HUD window, a tab view, a button and a NSImageView. When
I click the button, I raise an action on the application controller which
basically does the following:
[imageview setImage:toggle_image];
[imageview setFrame:toggle_rect];
[imageview setToolTip:toggle_tooltip];
When I click the button I want to toggle the
frame, image, and tooltip depending on 2 states. In the 1st state
(initial) the image is smaller and in the 2nd state it's bigger. The
origin of the image view is also repositioned.
An illustration of the 2 frame configurations would be:
|x| (width = 10, height = 10, x origin = 30, y origin = 0) 1st state
|xxxx| (width = 40, height = 10, x origin = 0, y origin = 0) 2nd state
Actually, this works great when core animation is disabled. However,
When I'm using core animation on a tab view which embeds the picture,
this doesn't work as expected: the first transition (1->2) works
nicely, but not the next (2->1). If I reverse the order, the first
transition (2->1) doesn't work. By "doesn't work as expected" I mean
the image and tooltips are correctly toggled but not the image frame.
When the frame becomes bigger (2->1), the frame
is
constantly kept _visually_ at this size in the following clicks and
never reduces
to the small size. One "interesting" thing
I've noticed is that, although the image is kept constant (in big
size), the tool tip only appears If I position the cursor in the area
where it would be considered correct (
e.g., after a 2->1 transition, the image frame is incorrectly kept big
but the the tooltip
only appears as if the frame would be correctly changed to small). At first
I thought this would be related to "dirty" screen buffers but that wouldn't
be possible since the image is updated all over the (incorrect) frame size.
Even so, I tried forcing the drawing on the NSImageView and tab view but
didn't produce any effect.
Although I haven't tried,
I believe that instead of using the same NSImageView I could use 2 for
the 2 different states, but still it doesn't make sense for me why
this isn't working.
Any hints?
Thanks in advance,
Mário Freitas
_______________________________________________
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