NSTextView & sizeToFit
NSTextView & sizeToFit
- Subject: NSTextView & sizeToFit
- From: Alessandro Volz <email@hidden>
- Date: Sat, 6 Mar 2004 02:12:38 +0100
hello again...
i noticed that calling sizeToFit on a NSTextView (static text) makes
the control frame change - it should become of a size containing the
text in a nice way... but thats not what happens:
if the text width is less than the starting frame width, the frame
width shrinks like it wanted to precisely contain the text but
unsuccessly: the text wraps to more lines than necessary :(
so after calling sizeToFit i get the frame rect, set the width to the
previous and set the frame to the resulting rect. ok, works
now, when checking with a text that will have to wrap on more lines...
the frame rect gets bigger than before and goes out of the window
bounds - if i resize the frame, the text wraps on more lines and is not
shown :(
now, maybe this has something to do with IB's Size pane? i mean, the
NSTextFields are IB-created and their size and autoresize fields are
defined - do they influence sizeToFit? how? does anyone know the
workaround?
2 days of obj-c, love it - cant see how i could do without it :)
thank you!!
Alessandro
---
Tous les chats sont mortels. Socrate est mortel. Donc Socrate est un
chat.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.