Closed LANDAISB closed 2 months ago
Use case example:
With less size:
May be this is not a ToLabel but another widget as ToText ?
Is is ok with a ToTextField ?
example: ToTextField new withLineWrapping; text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius felis finibus congue porttitor. Integer vehicula risus at odio porttitor semper. Aliquam erat volutpat. Curabitur feugiat tellus vitae massa interdum, ac ultrices dui scelerisque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nulla facilisi. In pulvinar dui lectus, vel auctor purus fermentum id.'; beReadonlyWithoutSelection; openInInnerWindow
Thanks ! I test and it works ! But i still have a question: I don't know how to set font name, size and color for textField. I used this for ToLabel:
self when: ToInstallLookEvent write: (self property: #'text-attributes-with-builder') with: [:e |
e textAttributesBuilder fontSize: (self getFontSize: 5).
e textAttributesBuilder defaultFontName: fontName.
e textAttributesBuilder light.
e textAttributesBuilder foreground: (Color quantumWhite100).
].
-> Which property should I use ?
initializeToTextFieldStyleRules
| fontName |
fontName := 'American Typewriter'.
self select: ToTextField asTypeSelector style: [
self select: #description asStampSelector style: [
self when: ToInstallLookEvent write: (self property: #'text-attributes-with-builder') with: [:e |
e textAttributesBuilder fontSize: (self getFontSize: 25).
e textAttributesBuilder defaultFontName: fontName.
e textAttributesBuilder light.
e textAttributesBuilder foreground: (Color red).
].
].
]
this should work now with my last commit (Toplo:dev)
Yes, it works on Toplo:dev. Thank you !
We have a need of a multi-lines label widget who can display text using the whole space, like a read-only TextArea.
Basically, a ToLabel multiLine but without explicit carrier return, automatically adapting to widget size.