Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawing on desktop in Mac OS X [closed]

Tags:

cocoa

desktop

I want to create analog of program conky. What is the best way to draw information on a OS X desktop?

like image 670
Igor Avatar asked Dec 04 '22 16:12

Igor


1 Answers

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.

like image 139
Marc Charbonneau Avatar answered Dec 16 '22 23:12

Marc Charbonneau