Inline drawer Xcode? - objective-c

I don't really know what it is but the icon on the top right of a finder window, (oval shaped button) when clicked hides the sidebar and toolbar icons, how can I implement something like this in my XCode project?
Thanks

As far as I can tell, this is just a standard NSButton that has a particular action bound to it. Adium has a similar button and is open source, you might try reading through the source code to see what they've done.
http://trac.adium.im/wiki/GettingNewestAdiumSource

Related

Creating semi-transparent, round cornered with border Window in Cocoa?

What would be the best approach for creating a Window that is semi-transparent, has round corners and an outline around its border and the arrow, but without the the title bar and buttons.
The window will pop up from the Menu Bar when a use clicks on the menu bar icon.
I'm looking to have an effect similar to the "Applications" and "Downloads" windows:
I guess I will need to do the drawing myself. But I'm wondering what's the best way to do this and whether there is anything already built into Cocoa that can minimize the effort? Or maybe a 3rd party project that has already done that (couldn't find anything exactly like that)?
Thanks.
You can create your window with
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
with a style-mask of NSBorderlessWindowMask which will give an unadorned window. Its how the Dock does its mechanics too.
Note that you must init with this style , you can't change an already init'ed windows style.
Place a custom NSView via the contentView accessor with your desired background custom drawing at the top of the windows view stack.
You might need also to setOpaque to NO
What you are looking for has been done a lot. Too much really.
The classes you want to look into are as follows.
NSStatusItem
This is something that appears in the status bar section of the menu bar to the right side.
NSMenu
If you want this from a menu in the application menus, you'll need to do some clever things with views in menus.
NSWindow
As the other poster notes a borderless window is one way to achieve this.
NSPopover
This is another way. Combined with the above, a fancy technique is to use a clear window called a cover window then, when clicking on the menu or status menu, invoke a popover from a point below that in the clear cover window.
That should be enough to get you started with what you should look into.
Beyond that, peruse the Mac App Store and also look at cocoacontrols.com and GitHub.

Connecting IBAction to a button in xcode5

I've been following this guide carefully and I got stuck here.
Click here
When I try to connect press ctrl and drag on my button, a popup comes up giving me options "Leading space to container, Center Vertically in container, Equal widths, equal height Aspect ratio" I don't see the option to press my button like in the guide. I read the comments below and it seems like everyone is having this problem. I know it's an old guide so that's probably the reason why
Just right click on the button and then you can normally drag from touchUpInside action to your view controller.
Instead of control-dragging from the storyboard to the storyboard, open up the Assistant Editor with the .m/.h file you want the action code to be in, and control-drag the button from the storyboard to somewhere in that document. Then you should be able to pick between IBOutlet and IBAction.
Hope this helps!

Xcode IB: Replace button with another type?

In my Xcode project, I have a few buttons in the main window that I would like to replace with another type of button. In this case, there are a few rectangles and a rounded rectangle button. Is there an easy way to replace the buttons with another style, or am I stuck with deleting them and settings them all up again? Thanks in advance!
You can select button type custom and use your own special background as the button in Interface Builder.
If you want to further customize your button, I suggest making an outlet of it and customize it programmatically.
Good Luck!

Implement a slide-sidebar like Tinder.app

Does anyone can open Tinder.app?
Well, the app implements a simple-but-slick animation effect when the user taps on the top-left menu icon button. The focal points of this animation are:
Status bar fades out/in based on when the left menu sidebar is opening or closing;
When the left menu sidebar is opened there's a little bounce effect of the main view controller just slide to right;
When the left menu is opened, if you try to close it you can see there's a little bounce of the main view controller that shows the right sidebar (the "All Matches" view controller).
I've just cloned ECSlidingViewController repo and played a little with it but unfortunately it seems that (out-of-the-box) it have only classic animations and not those bounce animations I said before I'm trying to achieve.
Does anyone knows how to implement something like that? Thanks.
You can find many ways to do this, you can wirte your own code to do this. But there are many free work available, which may helpful. And you will not try to reinvent the wheel.
IIViewDeckController
AppCoda
JTRevealSlidebar
SASlideMenu
JA Slide Panel
BenHall
SlideNavigationController
There are plenty more available, but above mentioned are easy to use and having demo project also.

Bug in Cocoa document-based app with the window's document icon popup menu

I have a document-based app that supports Versions and Autosave. When you click the proxy icon, a popup menu appears like in any other document app, too:
You notice this weird NSMenuItem item? It's not supposed to look like that. In Quartz Composer for example it looks like this:
I don't know why this happens, as I'm not doing anything with the window title or icon. There isn't even an API to customize this popup menu.
It would be great if somebody could help me to get this fixed or at least an idea of what could be the cause of this behavior.
Kind regards,
Fabian
Found a blog post with the solution. This worked for me:
Versions, validateMenuItem: and NSMenuItem