So just for the record, thanks to a hint from Stack Overflow I was able to 
solve the problem by just using ceil() on the size I get from [cell cellSize]. 
Maybe just passing [cell cellSize].width as a CGFloat to 
NSTableColumn::setWidth() would also do the job but I haven't tested this 
because my engine is tied to an integer column width so I'm just always 
rounding up now. Good to know that this can be solved without any advanced 
wizardry like constraint layouts, etc. :)

On 11.11.2020 at 17:27 Steven Mills via Cocoa-dev wrote:

> On Nov 11, 2020, at 10:13:35, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:

>> Yeah, but size.width is 0 too so something must be wrong in that code...

> Does it even have a superview at that point? I kinda think it
> doesn't, because the method you're in is supposed to return the cell
> view that the table will then stick into the row. And yes, its width
> will be 0 because it has no content yet.

>> No, because your words "mess with the constraints" didn't sound like this was
>> going to be a very elegant solution ;) 

>> Have you got any code on how to add constraints to the text field? I don't
>> really have the time to read and understand the whole auto layout shebang
>> just to give this a try. 

>> After all, I can't even get the NSTextField's size so I'm a bit skeptical
>> if auto layout is going to solve this since even such basic things as getting
>> the NSTextField's size don't seem to work...

> Well, constraints are the way to go. If you don't want to take the
> time to learn them or even how tables and view coordinates work,
> then I'm done offering suggestions.

> --
> Steve Mills
> Drummer, Mac geek

> _______________________________________________

> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/andreas%40falkenhahn.com

> This email sent to andr...@falkenhahn.com



-- 
Best regards,
 Andreas Falkenhahn                            mailto:andr...@falkenhahn.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to