Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Have a way to I block hide the NSMenu after click.
Thanks.
No, I've written several menubar apps and I've found the only way to disable menu-closing is to subclass NSMenuItem and do your own event handling. Unfortunately that also means you have to use a custom view, do your own title drawing, menu highlighting and "flash" animation.
Another option is to switch to a view based menu item. Then in your view class, respond to - (void) mouseUp:(NSEvent*) event and implement your custom behavior. The menu will not close on the click, as the event is no longer forwarded up the responder chain to the menu item.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have start programming a simple game. I don't use sprite Kit because it's very simple to use sprite Kit. But I have a problem with the levels. For now I'm using a lot of UIviews for levels, if level 1 is completed the next UIView with the second level is shown. Are UIViews a good idea for Levels ? Or is there a better way to add levels in simple game ?
It's rather a very bad idea to use UIViews as adding subviews and removing them can make your game sloppy. Instead what you should do is create a new ViewController and according to the levels you can set the level and other properties in the prepareForSegue method. I am listing some links here which will help you to learn about the topics :
Multiple ViewControllers
Segues
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
A quick one - I know that this has been asked a number of times but I can't find the answers on here. I have started a new project in Xcode and when I resize objects they resize from the other side of themselves, the controller moves with it etc. I know it is a simple setting somewhere but I can't find it - any helpers?
Your view controller is probably has auto layout enabled. When you resize one view, the others are resized according to their constraints.
To turn off auto layout: Select the view controller in IB, and in the properties pane on the right, open the first tab, and uncheck the Auto Layout checkbox.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a standard MasterDetailApplication for iPad.
From the DetailViewcontroller (if the iPad is in Portrait mode) the Segue "Image View" will be pushed. "Image View" has the size: iPad Full Screen.
With the swipe right or left, the MasterView will appear on the left side of "Image View". How can I avoid this?
Allpication will return to the Master-Detail View if the iPad is in Landscape mode.
Thanks!
In UISplitViewController there is a property to Specify whether the hidden view can be presented and dismissed via a swipe gesture.
The property name is presentsWithGesture
self.splitViewController.presentsWithGesture=NO;
Setting this property NO will disable gesture recognizer
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
This is a newbie question!
How to Create And Display a Custom Sheet in Cocoa? (like "Add Bookmark" sheet in Safari - see below)
What are the steps involved in the task?
How to accomplish each step?
Can you point out a good step-by-step article?
alt text http://grab.by/2oWw
All you need to do is make a nib file containing an NSWindow that you want to use as the sheet, and load it up. Check out Using Custom Sheets in the docs.
NSApplication has a method to let you load the sheet up:
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:
This page has some more information and what I'd consider an easier way to set up the sheet - making it a panel or window inside the same nib file as your document window.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to create analog of program conky. What is the best way to draw information on a OS X desktop?
NSWindow has a method, setLevel:, that lets you control how the window is positioned compared to other windows. From my own experience, you might want to try feeding it kCGDesktopIconWindowLevel, and calling setHasShadow:NO to implement the look you want. To actually do the drawing you would put a custom NSView subclass in your window, and create the window without a frame (see NSBorderlessWindowMask) and transparent ([window setBackgroundColor:[NSColor clearColor]], [self setOpaque:NO];).
You might also want to take a look at this article to keep your window pinned to the desktop during an Expose event.
Have you tried GeekTool? Maybe you don't even have to write the app. ☺
You need to take a look at using NSWindowLevel with a transparent window.