Re: NSView setFrameSize
Re: NSView setFrameSize
- Subject: Re: NSView setFrameSize
- From: John Stiles <email@hidden>
- Date: Wed, 25 Jan 2006 07:55:57 -0800
Use an NSTimer to implement this. If you use a for loop, your window
will probably not redraw like you want.
If I understand your description correctly, you can probably get the
effect you want by putting an NSBox (with an empty frame) inside your
window, and then putting a picture inside the NSBox. By properly setting
the springs on these views, you can make the box grow linearly as its
parent grows, and you can attach the picture to the right edge of the
box. That way you won't need to write any code other than resizing the
parent view frame.
haym37 wrote:
Hi,
Thanks for your quick reply. I am merely resizing an NSView; I am not
resizing anything within it. When I change the width of this NSView,
it expands it from the left to the right. When i = 5, let's say the
point of the top-right corner of the NSView will be 20 and the point
of the top-left corner will be 10, but then when i = 25, the point of
the top-right corner will be 40, and the point of the top-left corner
will remain 10. I want it so that the point of the top-left corner is
the one that moves and the top-right remains the same. Therefore, if
the point of the top-right corner starts at 25 and the top-left corner
is 20 when i = 5, when i = 25 the top-right corner will remain at 25,
but the top-left corner will become 0.
On Jan 25, 2006, at 10:36 AM, I. Savant wrote:
Hello:
For one thing, it's a bad idea to put this into a tight loop.
NSViewAnimation would be more suited for this purpose. A tight loop
will tie up your UI and possibly display the beachball -- a really
poor user experience.
I'm having a hard time visualizing exactly what you intend to
display, but it seems to me it'd be a lot easier just to swap
individual images (with the individual numbers in them) if you're
just doing a countdown type animation.
If this isn't the case, could you provide a more specific
description of the effect you're trying to accomplish?
--
I.S.
On Jan 25, 2006, at 10:28 AM, haym37 wrote:
Suppose that I had an NSView, with an image in it the same size of
the NSView. Now, I start the NSView with a width of 0. I want to
animate this image opening, so I have a for loop, pause in it for
about 5 milliseconds, and set the frame size (setFrameSize) of the
NSView to be i (i increments each time). Now, this slowly "opens
up" to the right. For instance, if my image just had the numbers
"1, 2, 3, 4, 5" from left to right, it would slowly show "1" then
"2" then "3", etc. But, I want it to "open up" to the left, so that
it first shows "5" then "4" then "3", etc. How would I do this?
Any help would be greatly appreciated. Thanks!
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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