Introduce OakCreateViewWithColor

This is useful when needing colored dividers in a layouts.
This commit is contained in:
Allan Odgaard
2013-01-14 04:03:48 +01:00
parent 538ba8220d
commit 87162c9897
2 changed files with 12 additions and 0 deletions

View File

@@ -3,6 +3,8 @@
PUBLIC extern NSString* const OakCursorDidHideNotification;
PUBLIC NSBox* OakCreateViewWithColor (NSColor* color = nil);
PUBLIC BOOL OakIsAlternateKeyOrMouseEvent (NSUInteger flags = NSAlternateKeyMask, NSEvent* anEvent = [NSApp currentEvent]);
PUBLIC void OakShowSheetForWindow (NSWindow* sheet, NSWindow* window, void(^callback)(NSInteger));
PUBLIC void OakShowAlertForWindow (NSAlert* alert, NSWindow* window, void(^callback)(NSInteger));

View File

@@ -2,6 +2,16 @@
NSString* const OakCursorDidHideNotification = @"OakCursorDidHideNotification";
NSBox* OakCreateViewWithColor (NSColor* color)
{
NSBox* box = [[[NSBox alloc] initWithFrame:NSZeroRect] autorelease];
box.boxType = NSBoxCustom;
box.borderType = NSLineBorder;
if(color)
box.borderColor = color;
return box;
}
void OakRunIOAlertPanel (char const* format, ...)
{
va_list ap;