On Wed, Feb 15, 2017 at 5:52 PM, Ben Coman <btc@openinworld.com> wrote:
On Wed, Feb 15, 2017 at 6:00 AM, chrismihaylyk <chrismihaylyk@gmail.com> wrote:
CyrilFerlicot wrote
Le 14/02/2017 à 21:41, chrismihaylyk a écrit :
Hello!
I need to get bold text. Can you help me what class I should use and all method to make text bold?
Hi!
Here an example opening a window with some bold text:
TextMorph new contents: ((Text string: 'I am bold' attribute: TextEmphasis bold), ' and I am normal text'); openInWindow
Does that fits your needs?
Hmm, why text is shown in white color instead bold, when I run the code?
This doesn't happen for me. Have you changed the UI theme?
And, honestly speaking, I need to be bold string stored in text variable in this example ('COLLECTION') which I pass in UIManager popup:
text := Text string: 'COLLECTION' attribute: TextEmphasis italic. UIManager default request: 'This is your ', text, ' name'.
AhhHa... Took me a moment to guess the root cause. I'll see if I can lead you to the same insight... Evaluate each of these and compare the result. ( 'This is your ', text, ' name' ) inspect. ( text, ' name' ) inspect.
Now debug each of those lines <Shift-Ctrl-D> and organise both debuggers beside each other. In each debugger step into... #, and you'll see both execute the same method from SequenceableCollection. Then step into... #copyReplaceFrom:to:with: and you'll see methods of different classes are executed.
To get what you want, check out the class side methods of Text to use with your first string.
HTH cheers -ben
hi Khrystyna, Did that work out okay for you? cheers -ben