Mac os x app for drawing

broken image
broken image

To properly enclose a rectangular content view in a circular frame, the frame would need a variable width (something I didn't want to set up for this simple post).Ī custom window may also want to handle truncation of the title when it gets too long.

broken image
broken image

This is too big for small windows and not enough for large windows to properly enclose the content view in a circle. You can download the complete Xcode 3.1 project for RoundWindow (63kB).ĭrawing a custom window with no behavior is simple but as with other types of custom controls, numerous little behavioral additions may be needed to make it feel truly polished.Īs a resizable circular window, the RoundWindow suffers from its fixed 75 by 75 pixel frame width. The code for determining the frame changes, while straightforward, is a little long to include here but you can look at the mouseDown: method in the RoundWindowFrameView to see how it's done. ( id ) initWithContentRect: ( NSRect ) contentRect styleMask: ( NSUInteger ) windowStyle backing: ( NSBackingStoreType ) bufferingType defer: ( BOOL ) deferCreation // Determine the frame changes for the mouse operation and apply.