Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.c
changeset 770:429ff505c450
prev765:4cd066048203
next773:146c3210768b
author nkeynes
date Mon Jul 28 03:41:25 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Implement key-binding configuration pane for Cocoa UI
Minor tweaks for consistency and static-correctness
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoaui.c Wed Jul 23 11:11:30 2008 +0000
1.2 +++ b/src/cocoaui/cocoaui.c Mon Jul 28 03:41:25 2008 +0000
1.3 @@ -378,6 +378,8 @@
1.4 modes: [NSArray arrayWithObject: NSDefaultRunLoopMode] ];
1.5 }
1.6
1.7 +/*************************** Convenience methods ***************************/
1.8 +
1.9 NSImage *NSImage_new_from_framebuffer( frame_buffer_t buffer )
1.10 {
1.11 NSBitmapImageRep *rep =
1.12 @@ -392,3 +394,18 @@
1.13 [image addRepresentation: rep];
1.14 return image;
1.15 }
1.16 +
1.17 +
1.18 +NSTextField *cocoa_gui_add_label( NSView *parent, NSString *text, NSRect frame )
1.19 +{
1.20 + NSTextField *label = [[NSTextField alloc] initWithFrame: frame];
1.21 + [label setStringValue: text];
1.22 + [label setBordered: NO];
1.23 + [label setDrawsBackground: NO];
1.24 + [label setEditable: NO];
1.25 + [label setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)];
1.26 + if( parent != NULL ) {
1.27 + [parent addSubview: label];
1.28 + }
1.29 + return label;
1.30 +}
.