• 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: Changing order of views dynamically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing order of views dynamically


  • Subject: Re: Changing order of views dynamically
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 25 Mar 2007 08:06:26 -0400

On Mar 25, 2007, at 7:52 AM, Sergey Shapovalov wrote:

Now my control has no sub-controls. It even has no sub-views. I perform all the drawing myself, by hand. Well, actually I have buttons in my control, but I just create them and tell them to draw their cells where I need. The code is like this:

	NSButton* btn = [[[NSButton alloc] init] autorelease];
	// ... (set button options) ...
	[[btn cell] drawWithFrame: myRectForButton inView: myControlView];

I don't actually include the buttons into my view hierarchy. The only thing I employ NSButton class for is drawing a button image. Of course I could use a grey rectangle or an arbitrary image instead, but I just like the way textured square buttons look in Cocoa.

I joined this thread rather late, so please forgive me if this is a stupid question. :-)


If all you want is the button's cell, why wouldn't you just create an instance of NSButtonCell directly?

sherm--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Changing order of views dynamically
      • From: Sergey Shapovalov <email@hidden>
References: 
 >Re: Changing order of views dynamically (From: Sergey Shapovalov <email@hidden>)
 >Re: Changing order of views dynamically (From: Ronny Reichmann <email@hidden>)
 >Re: Changing order of views dynamically (From: Sergey Shapovalov <email@hidden>)

  • Prev by Date: Re: Progress Sheet on a NSDocument
  • Next by Date: Re: Changing order of views dynamically
  • Previous by thread: Re: Changing order of views dynamically
  • Next by thread: Re: Changing order of views dynamically
  • Index(es):
    • Date
    • Thread