Spec LabelModel color

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

Spec LabelModel color

roberto.minelli@usi.ch
Hi,

I'm building a small UI with spec and I have a problem with the LabelModel.

Is there any way to change the default color (white) of the #text: in a LabelModel?

Thanks,
Roberto
Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Benjamin Van Ryseghem (Pharo)
In the latests image, it should be black :)

Which image are you using ?
Ben

On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:

Hi,

I'm building a small UI with spec and I have a problem with the LabelModel.

Is there any way to change the default color (white) of the #text: in a LabelModel?

Thanks,
Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Clément Béra
In reply to this post by roberto.minelli@usi.ch
I don't know any easy way to do it right now.

What I would do, as LabelModel>>#text: can take a Text instance as argument, is :
self text: ('the string I want to display' asText addAttribute: TextColor red) 

But of course it is not very good. 

Clement


2013/4/29 [hidden email] <[hidden email]>
Hi,

I'm building a small UI with spec and I have a problem with the LabelModel.

Is there any way to change the default color (white) of the #text: in a LabelModel?

Thanks,
Roberto



--
Clément Béra
Mate Virtual Machine Engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Benjamin Van Ryseghem (Pharo)
Now the default colour is specified in the corresponding Spec (LabelSpec here)

Otherwise, you should be able to specify the colour by sending the message color: too, but some morphs are slightly broken from this point of view :s
Ben

On Apr 29, 2013, at 1:45 PM, Clément Bera <[hidden email]> wrote:

I don't know any easy way to do it right now.

What I would do, as LabelModel>>#text: can take a Text instance as argument, is :
self text: ('the string I want to display' asText addAttribute: TextColor red) 

But of course it is not very good. 

Clement


2013/4/29 [hidden email] <[hidden email]>
Hi,

I'm building a small UI with spec and I have a problem with the LabelModel.

Is there any way to change the default color (white) of the #text: in a LabelModel?

Thanks,
Roberto



--
Clément Béra
Mate Virtual Machine Engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq

Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

roberto.minelli@usi.ch
In reply to this post by Benjamin Van Ryseghem (Pharo)
Thanks for the answers… I will update to the last image ;)

On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
 wrote:

> In the latests image, it should be black :)
>
> Which image are you using ?
> Ben
>
> On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:
>
>> Hi,
>>
>> I'm building a small UI with spec and I have a problem with the LabelModel.
>>
>> Is there any way to change the default color (white) of the #text: in a LabelModel?
>>
>> Thanks,
>> Roberto
>


Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

roberto.minelli@usi.ch
By the way.. I often use the Moose image hosted at

http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip

instead of the Pharo image.. And here Spec is not up to date.

When I run the "System>Software Update" from the World menu, packages are not updated, right?

I think it would be a nice-to-have.

Cheers,
R



On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:

> Thanks for the answers… I will update to the last image ;)
>
> On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
> wrote:
>
>> In the latests image, it should be black :)
>>
>> Which image are you using ?
>> Ben
>>
>> On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:
>>
>>> Hi,
>>>
>>> I'm building a small UI with spec and I have a problem with the LabelModel.
>>>
>>> Is there any way to change the default color (white) of the #text: in a LabelModel?
>>>
>>> Thanks,
>>> Roberto
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Benjamin Van Ryseghem (Pharo)
I can't say because I never use Moose image

Ben

On Apr 29, 2013, at 3:07 PM, "[hidden email]" <[hidden email]> wrote:

By the way.. I often use the Moose image hosted at

http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip

instead of the Pharo image.. And here Spec is not up to date.

When I run the "System>Software Update" from the World menu, packages are not updated, right?

I think it would be a nice-to-have.

Cheers,
R



On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:

Thanks for the answers… I will update to the last image ;)

On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
wrote:

In the latests image, it should be black :)

Which image are you using ?
Ben

On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:

Hi,

I'm building a small UI with spec and I have a problem with the LabelModel.

Is there any way to change the default color (white) of the #text: in a LabelModel?

Thanks,
Roberto






Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

roberto.minelli@usi.ch
By the way I used a fresh Pharo 2.0 image and labels are still white :D

Do I have to use Pharo 3.0 to have black labels?

Cheers,
R

On Apr 29, 2013, at 3:32 PM, Benjamin <[hidden email]>
 wrote:

> I can't say because I never use Moose image
>
> Ben
>
> On Apr 29, 2013, at 3:07 PM, "[hidden email]" <[hidden email]> wrote:
>
>> By the way.. I often use the Moose image hosted at
>>
>> http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip
>>
>> instead of the Pharo image.. And here Spec is not up to date.
>>
>> When I run the "System>Software Update" from the World menu, packages are not updated, right?
>>
>> I think it would be a nice-to-have.
>>
>> Cheers,
>> R
>>
>>
>>
>> On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:
>>
>>> Thanks for the answers… I will update to the last image ;)
>>>
>>> On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
>>> wrote:
>>>
>>>> In the latests image, it should be black :)
>>>>
>>>> Which image are you using ?
>>>> Ben
>>>>
>>>> On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm building a small UI with spec and I have a problem with the LabelModel.
>>>>>
>>>>> Is there any way to change the default color (white) of the #text: in a LabelModel?
>>>>>
>>>>> Thanks,
>>>>> Roberto
>>>>
>>>
>>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Clément Bera-3
          "Do I have to use Pharo 3.0 to have black labels?"

If you want to implement something for a customer, you should *not* use Pharo 3.0. It is in alpha state which means you might have unexpected bugs or VM crashes (even if the alpha version is currently quite stable). The best for you would be to patch a Pharo 2.0. For example patch LabelModel with :

LabelModel>>#text: aText
<api: #string getter: #getText registration: #whenTextChanged:>
"Set the text of the label"
textHolder contents: (aText asText addAttribute: TextColor black)

Then all the LabelModels will be black. 



2013/4/29 [hidden email] <[hidden email]>
By the way I used a fresh Pharo 2.0 image and labels are still white :D



Cheers,
R

On Apr 29, 2013, at 3:32 PM, Benjamin <[hidden email]>
 wrote:

> I can't say because I never use Moose image
>
> Ben
>
> On Apr 29, 2013, at 3:07 PM, "[hidden email]" <[hidden email]> wrote:
>
>> By the way.. I often use the Moose image hosted at
>>
>> http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip
>>
>> instead of the Pharo image.. And here Spec is not up to date.
>>
>> When I run the "System>Software Update" from the World menu, packages are not updated, right?
>>
>> I think it would be a nice-to-have.
>>
>> Cheers,
>> R
>>
>>
>>
>> On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:
>>
>>> Thanks for the answers… I will update to the last image ;)
>>>
>>> On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
>>> wrote:
>>>
>>>> In the latests image, it should be black :)
>>>>
>>>> Which image are you using ?
>>>> Ben
>>>>
>>>> On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm building a small UI with spec and I have a problem with the LabelModel.
>>>>>
>>>>> Is there any way to change the default color (white) of the #text: in a LabelModel?
>>>>>
>>>>> Thanks,
>>>>> Roberto
>>>>
>>>
>>>
>>
>>
>





--
Clément Béra
Mate Virtual Machine Engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Clément Béra
In reply to this post by roberto.minelli@usi.ch
 "Do I have to use Pharo 3.0 to have black labels?"

If you want to implement something for a customer, you should *not* use Pharo 3.0. It is in alpha state which means you might have unexpected bugs or VM crashes (even if the alpha version is currently quite stable). The best for you would be to patch a Pharo 2.0. For example patch LabelModel with :

LabelModel>>#text: aText
<api: #string getter: #getText registration: #whenTextChanged:>
"Set the text of the label"
textHolder contents: (aText asText addAttribute: TextColor black)

Then all the LabelModels will be black. 


2013/4/29 [hidden email] <[hidden email]>
By the way I used a fresh Pharo 2.0 image and labels are still white :D

Do I have to use Pharo 3.0 to have black labels?

Cheers,
R

On Apr 29, 2013, at 3:32 PM, Benjamin <[hidden email]>
 wrote:

> I can't say because I never use Moose image
>
> Ben
>
> On Apr 29, 2013, at 3:07 PM, "[hidden email]" <[hidden email]> wrote:
>
>> By the way.. I often use the Moose image hosted at
>>
>> http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip
>>
>> instead of the Pharo image.. And here Spec is not up to date.
>>
>> When I run the "System>Software Update" from the World menu, packages are not updated, right?
>>
>> I think it would be a nice-to-have.
>>
>> Cheers,
>> R
>>
>>
>>
>> On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:
>>
>>> Thanks for the answers… I will update to the last image ;)
>>>
>>> On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
>>> wrote:
>>>
>>>> In the latests image, it should be black :)
>>>>
>>>> Which image are you using ?
>>>> Ben
>>>>
>>>> On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm building a small UI with spec and I have a problem with the LabelModel.
>>>>>
>>>>> Is there any way to change the default color (white) of the #text: in a LabelModel?
>>>>>
>>>>> Thanks,
>>>>> Roberto
>>>>
>>>
>>>
>>
>>
>





--
Clément Béra
Mate Virtual Machine Engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

roberto.minelli@usi.ch
In reply to this post by Clément Bera-3
Thanks a lot. Now I implemented the solution you proposed in the previous mail and it works.

Cheers,
R

On Apr 29, 2013, at 4:49 PM, Clément Bera <[hidden email]>
 wrote:

>           "Do I have to use Pharo 3.0 to have black labels?"
>
> If you want to implement something for a customer, you should *not* use Pharo 3.0. It is in alpha state which means you might have unexpected bugs or VM crashes (even if the alpha version is currently quite stable). The best for you would be to patch a Pharo 2.0. For example patch LabelModel with :
>
> LabelModel>>#text: aText
> <api: #string getter: #getText registration: #whenTextChanged:>
> "Set the text of the label"
>
> textHolder contents: (aText asText addAttribute: TextColor black)
>
> Then all the LabelModels will be black.
>
>
>
> 2013/4/29 [hidden email] <[hidden email]>
> By the way I used a fresh Pharo 2.0 image and labels are still white :D
>
>
>
> Cheers,
> R
>
> On Apr 29, 2013, at 3:32 PM, Benjamin <[hidden email]>
>  wrote:
>
> > I can't say because I never use Moose image
> >
> > Ben
> >
> > On Apr 29, 2013, at 3:07 PM, "[hidden email]" <[hidden email]> wrote:
> >
> >> By the way.. I often use the Moose image hosted at
> >>
> >> http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip
> >>
> >> instead of the Pharo image.. And here Spec is not up to date.
> >>
> >> When I run the "System>Software Update" from the World menu, packages are not updated, right?
> >>
> >> I think it would be a nice-to-have.
> >>
> >> Cheers,
> >> R
> >>
> >>
> >>
> >> On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:
> >>
> >>> Thanks for the answers… I will update to the last image ;)
> >>>
> >>> On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
> >>> wrote:
> >>>
> >>>> In the latests image, it should be black :)
> >>>>
> >>>> Which image are you using ?
> >>>> Ben
> >>>>
> >>>> On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I'm building a small UI with spec and I have a problem with the LabelModel.
> >>>>>
> >>>>> Is there any way to change the default color (white) of the #text: in a LabelModel?
> >>>>>
> >>>>> Thanks,
> >>>>> Roberto
> >>>>
> >>>
> >>>
> >>
> >>
> >
>
>
>
>
>
> --
> Clément Béra
> Mate Virtual Machine Engineer
> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq


Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel color

Benjamin Van Ryseghem (Pharo)
In reply to this post by roberto.minelli@usi.ch
You could load the latest Spec but it depends on some Morphic changes so :s

Ben

On Apr 29, 2013, at 4:12 PM, [hidden email] wrote:

By the way I used a fresh Pharo 2.0 image and labels are still white :D

Do I have to use Pharo 3.0 to have black labels?

Cheers,
R

On Apr 29, 2013, at 3:32 PM, Benjamin <[hidden email]>
wrote:

I can't say because I never use Moose image

Ben

On Apr 29, 2013, at 3:07 PM, "[hidden email]" <[hidden email]> wrote:

By the way.. I often use the Moose image hosted at

http://ci.inria.fr/moose/job/moose-latest-dev-4.8/lastSuccessfulBuild/artifact/moose-latest-dev-4.8.zip

instead of the Pharo image.. And here Spec is not up to date.

When I run the "System>Software Update" from the World menu, packages are not updated, right?

I think it would be a nice-to-have.

Cheers,
R



On Apr 29, 2013, at 2:07 PM, [hidden email] wrote:

Thanks for the answers… I will update to the last image ;)

On Apr 29, 2013, at 1:38 PM, Benjamin <[hidden email]>
wrote:

In the latests image, it should be black :)

Which image are you using ?
Ben

On Apr 29, 2013, at 12:27 PM, [hidden email] wrote:

Hi,

I'm building a small UI with spec and I have a problem with the LabelModel.

Is there any way to change the default color (white) of the #text: in a LabelModel?

Thanks,
Roberto