views:

258

answers:

1

There are tutorials for using a webkit view inside a cocoa application to achieve skinnable contents, but what would I do if I wanted to use webkit to create custom, skinnable windows?

Examples would be dashboard widgets, or BowTie

Beware, I'm a noob.

A: 

I've never tried it, but I think you'd just set a WebView as the content view of a transparent borderless window, and tell the WebView not to draw a background. That way, the content of the WebView would define the window boundary.

You create a borderless window by passing NSBorderlessWindowMask to the -initWithContentRect:styleMask:backing:defer: method of NSWindow, and you can set its background to transparent by calling [window setBackgroundColor:[NSColor clearColor]].

You'd have to handle dragging of the window etc yourself. It will probably get a bit messy.

To be honest, it's not something I'd attempt as a first Cocoa project.

Rob Keniger
yeah, I'm aware that it's over my head, the plan is to collect info for better times. And it's nice where (or what) to look (for). So thanks!
Phil