Hello! I need to get bold text. Can you help me what class I should use and all method to make text bold? Thanks ^_^ -- View this message in context: http://forum.world.st/Bold-label-tp4934321.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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?
Thanks ^_^
-- View this message in context: http://forum.world.st/Bold-label-tp4934321.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Cyril Ferlicot http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France
Hmm, why this is shown in white color instead bold? 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'. -- View this message in context: http://forum.world.st/Bold-label-tp4934321p4934325.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi you may not are realised it but you can read the code of popup: You can also add a new method if needed. Stef
Hmm, why this is shown in white color instead bold?
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'.
-- View this message in context: http://forum.world.st/Bold-label-tp4934321p4934325.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Using Opera's mail client: http://www.opera.com/mail/
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?
Thanks ^_^
-- View this message in context: http://forum.world.st/Bold-label-tp4934321.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Cyril Ferlicot
2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France
signature.asc (836 bytes) <http://forum.world.st/attachment/4934322/0/signature.asc>
Hmm, why text is shown in white color instead bold, when I run the code? 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'. -- View this message in context: http://forum.world.st/Bold-label-tp4934321p4934328.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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
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
participants (4)
-
Ben Coman -
chrismihaylyk -
Cyril Ferlicot D. -
stepharong