Drawing on desktop in Mac OS X [closed] - cocoa

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.

Related

Levels in xcode (swift) [closed]

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

UIViewController moves when resizing objects on it [closed]

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.

Dont hide NSMenu after click [closed]

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.

Is it possible to separate the XAML page into designer and xaml windows? [closed]

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
I am coding up a Windows Phone 7 app and as large as my screen is, I'd like to separate the designer from the XAML coding window and throw it onto another screen.
Possible?
I'm not sure if this is what you want but if you double click on the "XAML" or "Design" tabs in-between the two panes it will maximize that tab and you can then use the tabs to switch back and forth between design view and XAML view.
Hope this helps
Edit: If you want to go back to split pane view there are three very small icons at the bottom right and you can click one of those to either split vertically or horizontally. The one with the double arrows will also let you switch back and forth between single and split pane views.
Edit: I found this on MSDN which makes it seem that they had the split view so that
...if you drag a control from the
Toolbox to Design view, the XAML is
immediately updated to reflect the new
element. Likewise, if a new element is
added by typing the markup in XAML
view, the visual representation will
appear in Design view immediately,
once the XAML is correctly formed.
Edit 3: Looks like someone found an answer before. You may want to try this:
Separating designer from XAML window for WPF in VS2010

How to Create And Display a Custom Sheet in Cocoa? [closed]

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.

Resources