Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing NSButton doesn't clear previous size



On 28 Jun 2004, at 4:23 am, Frederick C. Lee wrote:

1) Create a NSButton object with a long title like: "Select Montreal".
2) Reset the title to a smaller string like: "Select Paris" per
following statements:

[selectCity_Button setTitle:buttonStr];
[selectCity_Button sizeToFit];
[selectCity_Button display];

3) View the new button. What you'll see is a piece of the previous
button that didn't get erased from the screen: "...eal"

The button won't redraw things that are outside its frame. Try

[selectCity_Button setTitle:buttonStr];
[selectCity_Button sizeToFit];
[[selectCity_Button superview] setNeedsDisplay:YES];

which will cause the superview and its subviews to be redrawn.

Regards,
-Jeremy
_______________________________________________
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.


References: 
 >Resizing NSButton doesn't clear previous size (From: "Frederick C. Lee" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.