Bold label

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Bold label

chrismihaylyk
This post was updated on .
Hello!

I need to get bold text. Can you help me what class I should use and what method to make text bold?

Thanks ^_^
Reply | Threaded
Open this post in threaded view
|

Re: Bold label

CyrilFerlicot
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


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bold label

chrismihaylyk
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

http://www.synectique.eu

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'.
Reply | Threaded
Open this post in threaded view
|

Re: Bold label

stepharong
In reply to this post by CyrilFerlicot
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/

Reply | Threaded
Open this post in threaded view
|

Re: Bold label

Ben Coman
In reply to this post by chrismihaylyk


On Wed, Feb 15, 2017 at 6:00 AM, chrismihaylyk <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Bold label

Ben Coman
On Wed, Feb 15, 2017 at 5:52 PM, Ben Coman <[hidden email]> wrote:

>
>
> On Wed, Feb 15, 2017 at 6:00 AM, chrismihaylyk <[hidden email]>
> 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