2015-08-14 21:50:20 -05:00
|
|
|
// 14 august 2015
|
|
|
|
#import "uipriv_darwin.h"
|
|
|
|
|
|
|
|
struct uiLabel {
|
|
|
|
uiDarwinControl c;
|
2015-08-17 14:20:46 -05:00
|
|
|
NSTextField *textfield;
|
2015-08-14 21:50:20 -05:00
|
|
|
};
|
|
|
|
|
2016-04-25 10:54:09 -05:00
|
|
|
uiDarwinControlAllDefaults(uiLabel, textfield)
|
2015-08-14 21:50:20 -05:00
|
|
|
|
2015-08-16 22:44:23 -05:00
|
|
|
char *uiLabelText(uiLabel *l)
|
2015-08-14 21:50:20 -05:00
|
|
|
{
|
|
|
|
return uiDarwinNSStringToText([l->textfield stringValue]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void uiLabelSetText(uiLabel *l, const char *text)
|
|
|
|
{
|
2018-05-03 21:38:21 -05:00
|
|
|
[l->textfield setStringValue:uiprivToNSString(text)];
|
2015-08-14 21:50:20 -05:00
|
|
|
}
|
|
|
|
|
2016-06-07 10:29:49 -05:00
|
|
|
NSTextField *newLabel(NSString *str)
|
|
|
|
{
|
|
|
|
NSTextField *tf;
|
|
|
|
|
|
|
|
tf = [[NSTextField alloc] initWithFrame:NSZeroRect];
|
|
|
|
[tf setStringValue:str];
|
|
|
|
[tf setEditable:NO];
|
|
|
|
[tf setSelectable:NO];
|
|
|
|
[tf setDrawsBackground:NO];
|
2018-05-04 19:26:13 -05:00
|
|
|
uiprivFinishNewTextField(tf, NO);
|
2016-06-07 10:29:49 -05:00
|
|
|
return tf;
|
|
|
|
}
|
|
|
|
|
2015-08-14 21:50:20 -05:00
|
|
|
uiLabel *uiNewLabel(const char *text)
|
|
|
|
{
|
|
|
|
uiLabel *l;
|
|
|
|
|
2016-04-25 10:54:09 -05:00
|
|
|
uiDarwinNewControl(uiLabel, l);
|
2015-08-14 21:50:20 -05:00
|
|
|
|
2018-05-03 21:38:21 -05:00
|
|
|
l->textfield = newLabel(uiprivToNSString(text));
|
2015-08-14 21:50:20 -05:00
|
|
|
|
|
|
|
return l;
|
|
|
|
}
|