• 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: Sergey Shapovalov <email@hidden>
  • Date: Sun, 25 Mar 2007 16:17:46 +0400

Sherm,

On Mar 25, 2007, at 4:06 PM, Sherm Pendley wrote:

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?

Yes, good point. NSButtonCell is sufficient for me, I don't need an entire NSButton. Thank you for the idea! Already tried it in a small test - everything does work!

Best regards,
Sergey.
_______________________________________________

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


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>)
 >Re: Changing order of views dynamically (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Changing order of views dynamically
  • Next by Date: binding bool value??
  • Previous by thread: Re: Changing order of views dynamically
  • Next by thread: C++ MAC Cocoa & Powerplant developer required for contract in Antwerp, Belgium
  • Index(es):
    • Date
    • Thread