• 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: Resizing NSButton doesn't clear previous size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing NSButton doesn't clear previous size


  • Subject: Re: Resizing NSButton doesn't clear previous size
  • From: Jeremy Dronfield <email@hidden>
  • Date: Mon, 28 Jun 2004 09:53:03 +0100

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>)

  • Prev by Date: Re: Rotating Images....
  • Next by Date: Fonts
  • Previous by thread: Resizing NSButton doesn't clear previous size
  • Next by thread: Re: Resizing NSButton doesn't clear previous size
  • Index(es):
    • Date
    • Thread