Re: Questions regarding programming custom visual components
Re: Questions regarding programming custom visual components
- Subject: Re: Questions regarding programming custom visual components
- From: Kyle Sluder <email@hidden>
- Date: Mon, 2 Feb 2009 11:51:16 -0500
On Mon, Feb 2, 2009 at 9:16 AM, Vince <email@hidden> wrote:
> 1. Can I add elements to an NSWindow's title bar (without having to rebuild
> the entire window on my own)? In my case I'd just like to put an image right
> underneath the window's title.
> (kind of like what the OmniGroup did with the OmniFocus beta:
> http://cache.lifehacker.com/assets/resources/2008/01/omnifocus-header.png)
You can use -[NSWindow standardWindowButton:] to get a pointer to one
of the window buttons, and then send it -superview. There's no
guarantee that this is actually going to be the view that draws the
background, however; you might want to instead use a textured window
and draw a custom background yourself. Textured window dimensions are
the same as regular window dimensions on Leopard, so you're in luck
there.
> 2a) How would I get that connection point between those two panels done with
> NSViews?
> Wouldn't I need to overlap the views (works since Leopard, I read)? Or is
> there a better (= valid) solution for this?
You don't need to wrap your subviews in other subviews; why not just
draw the background for all the views inside your container view's
-drawRect: implementation?
> 2b) As you can see it will need semi-transparent gradients, some kind of
> inner glow and last but not least an outer glow and drop shadow.
> I googled, and googled, and googled… but couldn't find any demonstrative
> tutorial/instruction/guide on building such a custom view component.
The cool thing about the Quartz rendering model is that you can
usually get the same results you got in Photoshop by doing the exact
same things, since both rendering models share a lot with the PDF
model. This means dropping down to Core Graphics sometimes, but it's
not that bad.
--Kyle Sluder
>
> The only guide I found—that might do the trick—was from Scott Stevenson
> (http://cocoadevcentral.com/d/intro_to_quartz_two/).
>
> So, before I start trying this in Scott's way, I wanted to ask you if there
> is any better way of programming such (code rendered) custom controls
> without the use of images (in order to achieve resolution independence)?
>
> Btw, wouldn't it be great to have some kind of programmatic equivalent for
> Photoshop's shape styles in Cocoa?
> This way one could design his complex custom elements in Photoshop using
> "Layer Styles" and then translate it to Cocoa "Shape Styles" almost 1:1. (Or
> do it all in code, with no translation, right from the beginning.)
>
> Thanks in advance,
> Vince_______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please 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
>
--
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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