Re: six things I wasn't able to do with Cocoa
Re: six things I wasn't able to do with Cocoa
- Subject: Re: six things I wasn't able to do with Cocoa
- From: Kevin Wojniak <email@hidden>
- Date: Fri, 28 May 2010 09:04:41 -0700
On May 27, 2010, at 12:43 PM, Bill Appleton wrote:
> *4)** **I **can't call the printing code*
>
> I know, the printing code calls me. But other platforms don't work like
> this. I eventually used Core Printing and the Cocoa dialogs by sub-classing
> and faking out NSPrintPanel. Is there a better way?
Can you be more specific? Have you looked at NSPrintOperation setShowsPrintPanel: ?
> *5)** **I **can't create a simple list*
>
> I did it the only way I could -- with a table that has one column, etc. Man
> that was painful for a simple list. Is there a better way?
As others have said, but I'll reiterate, bindings make this ridiculously easy.
> *6)** **I **can't get the height of some wrapped text*
>
> I had to use the layout manager and some major rocket science to get this to
> work right. I'm not saying Text Edit was great, but at least it knows how
> tall the text field is.
I have a method for doing this and once the initial data is created and cached, it takes 4 lines of code to calculate the height of text for a width. While it's not as obvious as -[NSAttributedString size], I certainly wouldn't consider it rocket science :). I believe the code originated from Apple's docs too.
Kevin
_______________________________________________
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