how to create a another dock - objective-c

I want to create a dock which will contain some application's icon and at runtime user can add application to that dock by dragging them to dock. when user click on any app icon present in that dock, that app should lunch
hare I don't want to replace the system dock or i am not trying to create a dock inside a application . this is just a another dock in system .
so can any one tell me how to setup this dock app.

Just create a NSWindow, and set the correct level with -[NSWindow setLevel:NSDockWindowLevel];
You can also set a window not to have top bar with buttons and to have transparent contentView.
Then you should handle drag and drop of applications.

Related

Dragging a dock panel from one host window to another?

I'm wondering if anyone knows how to configure DockPanelSuite to allow dragging of docked windows from one dock container window to another? The demo application shows the menu option Window --> New Window, which creates a new dock container window, but dockable windows cannot be dragged between the two (for example to support multiple monitors with a dock container window on each screen).

Hide app icon in dock when minimized

I am new at Mac OSx development.
The app that I am creating requires removing the app icon from the dock throughout the application. The app allows minimizing and closing of the app window. Relaunching or reopening of the closed or minimized app window is done by clicking the app's icon from the status bar.
I was able to set the dock icon to be disabled during app launching; however, when the app is minimized (clicking the minimize button), it captures the image of the app's current window and adds it to the dock. I don't want that to occur. The app should not add any item to the dock.
Questions:
Does Apple allow removal of the app's re-launcher image from the dock when minimized?
If Apple allows this, how can I hide or remove the app from the dock?
Any help would be a big help! Thanks!
You cannot disable the display of a proxy tile when your window is minimized -- that's the primary way that users will restore a minimized window. If you'd rather that the window disappear entirely when it's not being used, disable minimization (in the window's flags) and have the user close the window instead.

Use LSUIElement (aka no Dock icon) but retain the "File, Edit, View" menubar?

I want my app to have:
Menubar extra icon (by the clock)
App Menubar ("File, Edit, View, Etc")
I do not want my app to have:
Dock Icon
Is this possible? I am deploying for 10.6 and 10.7 via the Mac App Store if that matters.
Setting LSUIElement in the info.plist file removes the dock icon, but it also removes the menubar.
NSApplication's setActivationPolicy might be what you are after.
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
Please note the discussion:
Currently, NSApplicationActivationPolicyNone and
NSApplicationActivationPolicyAccessory may be changed to
NSApplicationActivationPolicyRegular, but other modifications are not
supported.Needs links to running application
As per NSApplicationActivationPolicyAccessory's documentation you may need to programmatically ensure that the menu bar appears.
You could create two "separate" applications. One that has a dock icon and menu items,the other one has just the icon by the clock.
When you click on the icon by the clock it launches the dock application. When you close the dock application the 'background' application stays running.
If that model will work for you then that's the way to go. But I would weigh that effort against what File-Edit-View will do for you.

Is it possible to show the dock icon when a new Window is called?

I have an app that's shown as a Menu on the Status Bar, so I switched the "Application is agent (UIElement)" in plist to YES (because I dont want an icon on the dock just for a Menu on the Status Bar), but when I click an Item on the Menu a new window is called, is it possible to make a dock icon appear for that window? and disappear when the window is closed?
You will need to create a separate application binary/bundle to display that window. There is no supported way for an application to cause a Dock icon to be displayed on anything other than a per-process basis, or to dynamically hide/show the Dock icon while it's running.
You can show and hide the Dock icon of an application with NSRunningApplication+DockIcon but beware, this code uses undocumented APIs.
To set your application to be a foreground application, which causes its icon to appear in the Dock, and the app to appear in the Cmd+Tab list:
ProcessSerialNumber processSerialNumber = {0, kCurrentProcess};
TransformProcessType(&processSerialNumber, kProcessTransformToForegroundApplication);
And to change it back again:
ProcessSerialNumber processSerialNumber = {0, kCurrentProcess};
TransformProcessType(&processSerialNumber, kProcessTransformToUIElementApplication);

Making the Name of the App appear in the Menubar (top-left corner) when the App is LSUIElement

How would I make the name of the app appear here ( like with a normal app )…
alt text http://snapplr.com/snap/6sgc
… when the app is an LSUIElement.
My Problem is that when the App is LSUIElement the name is not by default displayed in the menu bar like an normal app. Basically all I want LSUIElement to do is to hide the dock icon not the name in the menu bar.
For those who's native language isn't English, when I say 'App' i mean 'Application'.
Thanks.
Don't do this; it's not what users expect. A dock icon and menu bar go together. If you want to get both a dock icon and menu bar icon in your UIElement app, use TransformProcessType.
If you really must, you can draw your own menu bar window (if you use the appropriate window level it'll appear over the top of the existing menu bar).