--- a/src/cocoaui/cocoaui.c Wed Jul 23 11:11:30 2008 +0000 +++ b/src/cocoaui/cocoaui.c Mon Jul 28 03:41:25 2008 +0000 @@ -378,6 +378,8 @@ modes: [NSArray arrayWithObject: NSDefaultRunLoopMode] ]; } +/*************************** Convenience methods ***************************/ + NSImage *NSImage_new_from_framebuffer( frame_buffer_t buffer ) { NSBitmapImageRep *rep = @@ -392,3 +394,18 @@ [image addRepresentation: rep]; return image; } + + +NSTextField *cocoa_gui_add_label( NSView *parent, NSString *text, NSRect frame ) +{ + NSTextField *label = [[NSTextField alloc] initWithFrame: frame]; + [label setStringValue: text]; + [label setBordered: NO]; + [label setDrawsBackground: NO]; + [label setEditable: NO]; + [label setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)]; + if( parent != NULL ) { + [parent addSubview: label]; + } + return label; +}