Re: OS X: how to create a text label?
Re: OS X: how to create a text label?
- Subject: Re: OS X: how to create a text label?
- From: John Joyce <email@hidden>
- Date: Thu, 9 Dec 2010 08:49:56 +0900
Do not assume they are the same!
They are quite *similar* but method names and available methods can be very different between Cocoa and Cocoa touch.
On Dec 9, 2010, at 5:25 AM, Artemiy Pavlov wrote:
> Oh, wonderful, thank you, Laurent!
>
> I assume NSTextField will work the same way as in iOS, right? E.g. this tutorial will apply:
> http://icodeblog.com/2010/01/04/uitextfield-a-complete-api-overview/
>
> Artemiy.
>
> On 8 Dec 2010, at 21:42, Laurent Daudelin wrote:
>
>> On Dec 8, 2010, at 11:15, Artemiy Pavlov wrote:
>>
>>> Hi all!
>>>
>>> I would like to add a simple text label to my Cocoa UI on OS X, programaticaly. It's just a static text label that'll be there unchanged, that has a certain font, size and color. What is the best way to do this?
>>>
>>> I assumed this would be as easy as with NSBezierCurve, but it doesn't seem that clear from the official Cocoa documentation.
>>>
>>> Would appreciate any advise!
>>>
>>
>> NSRect myRect = NSMakeRect(10.f, 10.f, 60.f, 20.f);
>> NSTextField *myTextField = [[NSTextField alloc] initWithFrame:myRect];
>> [myTextField setEditable:NO];
>> [myTextField setFont:…. and so on...
>>
>> -Laurent.
>> --
>> Laurent Daudelin
>> AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
>> Logiciels Nemesys Software email@hidden
>>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden