How do you draw to the desktop in Lion? [duplicate] - objective-c

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Drawing on desktop in Mac OS X
How can I draw directly to the desktop (behind the icons) in OSX Lion using objective c? I know it is possible because there are some applications in the app store that allow you to do this.

Take a look at this question Drawing on desktop in Mac OS X

You never draw directly to the desktop. The best you can do is to create a transparent window just above the desktop and draw in there.

Related

Detecting screen resize in mac os [duplicate]

This question already has answers here:
Detect when a Mac OS X window is resized or moved
(5 answers)
Closed 1 year ago.
I’ve got an objective C sprite kit game that works fine in a standard window size, however when the game window is resized to full screen, the main character sprite needs to have its y axis changed. In order to implement this, I need to check if the window has been resized in the game loop. how do I go about doing this?
You can use NSWindowDelagate. The NSWindowDelegate protocol has windowWillResize:toSize: and windowWillMove: methods.

iOS: How do you plot points and draw lines [duplicate]

This question already has answers here:
Draw lines between points(multiple)
(2 answers)
Closed 8 years ago.
Can someone show me an example on how to plot points and connect them in iOS objective C. Do I need to put CGPoint's in an array or can we draw one point at a time? What we want to do is calculate the corresponding y value from x value and make a CGPoint and plot them, in a for loop.
Thank you
It's not really about what language you are using, it's about what technology stack you are using. iOS? Mac? Then there are many options: 3rd party library, Core Plot, Core Graphics (2D procedural drawing API), Open GL, Core Animation (2D/3D compositing and animation API) or even some combination of these.
The correct answer depends on what you are building, big picture.
As it stands I think the question is to broad to answer.

ImageView for all iPhones in Common Sizes [duplicate]

This question already has answers here:
Images for iphone 5 retina display
(5 answers)
Closed 9 years ago.
So typically on storyboard, you assign an imageview with the image you want (foo.png) and then the phones automatically upsize to the retina version if one is on the iPhone 4 or 4s (foo#2x.png).
The question is, how do you get an image to display properly on a 4'' iPhone 5? It is all out of whack when I try it in the simulator and Apple has yet to address this situation with a simple solution as they did with the Retina display of the iPhone 4's. Any help? Thanks!
iPhone 5 support can be added very simply by adding a default#2x-568.png file to your project. Beyond that, it is only a case of making certain the app scales to a new size correctly. Make sure your views accomodate to the new size either programatically, or by setting springs and struts correctly in your UI archives (XIBs or Storyboards as appropriate). You shouldn't need any new images (*). If you already
support retina devices, then you only need to add the new splash screen as above.
(*) If you do for whatever reason, I'd recommend reading this answer:
ios6 UIImageView - Loading -568h image
Apple doesn't provide a good way of using different images on the iPhone 5, because you aren't supposed to use any!

UIImageViews, xibs, and suffixes (#2x, ~iphone, ~ipad) [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Specify images for iPad in Xcode like #2x for iPhone 4
I'm having trouble finding current conclusive information about how to properly use images based on device classes (Apple documentation being like a maze of twisted corridors, all alike). My sense is that this is something that has evolved a bit over time. Suppose I want to support non-retina and retina iphones and ipads with different images.
Here are all the permutations of filenames that I can think of:
image.png
image#2x.png
image~iphone.png
image~ipad.png
image#2x~iphone.png
image#2x~ipad.png
I could do this:
myview.xib
myview~ipad.xib
Suppose I have four devices, iPhone 3GS, iPhone 4, iPad 2, iPad 3 (or 'new iPad' for purists).
Let's talk about how I would set up my xibs (i.e. I add a UIImageView, what do I choose for an image?) to use the appropriate image and how, if I use code, [UIImage imageNamed:#"image"] would behave.
It's my understanding that in code I could fall back on UI_USER_INTERFACE_IDIOM() but I'm not convinced that I need to.
If someone could explain what will and won't work, I know that it'll be a help to me, and I suspect to others. If I've somehow duplicated another SO question I couldn't find, well, we can close this up and link to it. Thanks!
in iphone xib you have to use image~iphone. on ipad xib you have to use image~ipad. #2x is automatic selected when file is needed.

What should I use to control input devices and more [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am fluent in C++, Java, and Python and can pretty much pick up any other skill given enough time (no surprise there, I'm sure 99.9% of the people reading this share the same ability).
I have an idea for a small app for Mac OS X and I was wondering what technology I should employ/learn to get it working. I need some minimal OS X integration to get this done right.
I'm thinking I should probably use objective-C with Cocoa, but if this could be done with some Java library I would prefer that.
My Mac OS X application would do the following:
Be able to intercept all keyboard and mouse input regardless of active (focused) application and select to either block it (effectively disabling input) or act on receipt of certain keyboard shortcuts.
Have a Mac OS X menu bar item (at the top right of the screen next to the battery, network adapter, etc.)
Be able to occupy the entire screen at times (with some OpenGL canvas to display animations, much like a screen saver does)
Have sound.
What technologies would you recommend?
My Mac OS X application would do the following:
Be able to intercept all keyboard and mouse input regardless of active (focused) application and select to either block it (effectively disabling input) or act on receipt of certain keyboard shortcuts.
CGEventTap.
Have a Mac OS X menu bar item (at the top right of the screen next to the battery, network adapter, etc.)
NSStatusItem.
Be able to occupy the entire screen at times (with some OpenGL canvas to display animations, much like a screen saver does)
Any NSView can do this, but for OpenGL, you'll want NSOpenGLView specifically.
Alternatively to the usual full-screen method, you might prefer to put the view in a window at the screen-saver level. Try both ways and see which works best for you.
Have sound.
NSSound.
If you are well versed in C based languages, Cocoa is an excellent place to start and would probably be the easiest for the tasks you describe. Start here for cocoa: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html
Python has some excellent support as well, you can look here for modules that may contain what you need: http://docs.python.org/library/mac.html
If you would prefer Java, here is where I would start looking for the functionality you need: http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/05-CoreJavaAPIs/CoreJavaAPIs.html
I'm not sure honestly which to recommend, I can just say cocoa will probably have the best support for any integration you may need.
This started out as a comment but got too big.
I think you could do most of this with Java - menu icons, for instance, can be done through the SystemTray API which puts them in the relevant place on Windows or OS X. A previous specific answer on this : System Tray (Menu Extras) icon in Mac Os using Java
The key question is whether Java has APIs to grab 'raw' events from the OS, or only when focus is on the application. The standard KeyListener, for instance, is linked to a component with focus.
However, given the nature of the application, I'd suggest going with Cocoa. This would also allow you to use Core Animation (a higher level abstraction over Quartz / OpenGL).