Re: QuickTime Player - like application
Re: QuickTime Player - like application
- Subject: Re: QuickTime Player - like application
- From: Ken Thomases <email@hidden>
- Date: Wed, 11 May 2011 16:05:52 -0500
On May 11, 2011, at 3:25 PM, Nick wrote:
> Could you please explain me what frameworks/techniques does a
> QuickTime Player use to achieve the looks it has now?
Sadly, Apple sometimes implements GUIs in their own apps that are not easily reproducible with supported APIs. Sometimes that's a prelude to them making those changes generally available, sometimes not.
> How to force the window to make its titlebar/playback control bar
> disappear, when the mouse is not over the window?
> How to change the color of the window/titlebar?
The QuickTime Player almost certainly is implemented as a borderless window. The title bar that it shows is manually implemented as a view or layer within the window. It's not a real title bar, it just recreates the behavior and (to some extent) the appearance of one.
You might find the +[NSWindow standardWindowButton:forStyleMask:] method useful for obtaining the standard buttons that you can put into your own view hierarchy to at least get that part to look and behave correctly.
> how to make a control panel (with play/pause/stop buttons) that can
> slide only within the main window that's being displayed?
I answered this one before. I would guess that QuickTime Player is using either a layer-backed view hierarchy or even just a layer-hosting view (with a hierarchy of layers but not subviews). You would have to manually move the view or layer in response to mouse drags. The View Programming Guide describes techniques for handling mouse drags in your custom views.
> how to make such a customized control buttons? (they look very
> different from default default mac os buttons
See the Control and Cell Programming Topics for Cocoa. Basically, you can make a custom view or control (a control is just a special kind of view) that draws itself however you like and responds to events however you like.
> how to make the window resize preserving a specific aspect ratio?
See -[NSWindow setContentAspectRatio:]. Did you search the docs at all before asking?
> Sorry if my questions seem naive, i am a beginner in cocoa development :)
> Could you please point what guides/references (the names) to look at
> to make such things?
There is not going to be a step-by-step guide to do any possible GUI. There can only be general guides to the features available within the API, and you'll have to figure out how to put those features together to make the GUI you envision. Each class lists conceptual documentation in its overview. You should carefully read both the class reference and the associated conceptual documentation. At a minimum, that includes the Window Programming Guide and the View Programming Guide. For a GUI which uses Core Animation, there's the Core Animation Programming Guide, of course.
In general, you might go to the Reference Library and pick the User Experience or Graphics & Animation topics on the left, sort by resource type, and then read the Getting Started resources, then scan the list of Guides to see which you think may apply to your question and read those.
http://developer.apple.com/library/mac/navigation/#section=Topics&topic=User Experience
http://developer.apple.com/library/mac/navigation/#section=Topics&topic=Graphics & Animation
Regards,
Ken
_______________________________________________
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