Roassal2 - update RTLabel Shape

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

Roassal2 - update RTLabel Shape

Leo Perard
Hi,

I want to update the shape of an element which has an RTShape and I want to change the text.
When I update nothing append. If I change the color it works so I think there is bug when updating the text.


view := RTView new.
el := (RTLabel new text: 'Hello') element.
view add: el.
el on: TRMouseLeftClick do: [ :event | el shape text: 'Change'; color: Color red. el update. view signalUpdate ].
view open

--
Cheers,
Leo Perard
University of Lille 1

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal2 - update RTLabel Shape

abergel
Hi!

I’ve fixed this. However this is not perfect. You will have no problem if you change a string line for another string line.

However, the following does not work:
-=-=-=-=-=-=-=-=-=-=-=-=
view := RTView new.
el := (RTLabel new text: 'Hello') element.
view add: el.
el on: TRMouseLeftClick do: [ :event | el shape text: 'Change', String cr, 'the world'; color: Color red. el update. view signalUpdate ].
view
-=-=-=-=-=-=-=-=-=-=-=-=

And this one (unfortunately) raises an error:
-=-=-=-=-=-=-=-=-=-=-=-=
view := RTView new.
el := (RTLabel new text: 'Hello', String cr, 'World') element.
view add: el.
el on: TRMouseLeftClick do: [ :event | el shape text: 'Change', String cr, 'the world'; color: Color red. el update. view signalUpdate ].
view
-=-=-=-=-=-=-=-=-=-=-=-=

A bit more work is needed for now… TRLabelShape should be probably aware of multi-lines texts.

Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 2, 2014, at 9:23 AM, Leo Perard <[hidden email]> wrote:

> Hi,
>
> I want to update the shape of an element which has an RTShape and I want to change the text.
> When I update nothing append. If I change the color it works so I think there is bug when updating the text.
>
>
> view := RTView new.
> el := (RTLabel new text: 'Hello') element.
> view add: el.
> el on: TRMouseLeftClick do: [ :event | el shape text: 'Change'; color: Color red. el update. view signalUpdate ].
> view open
>
> --
> Cheers,
> Leo Perard
> University of Lille 1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal2 - update RTLabel Shape

Leo Perard
Ok cool. For now I do not use dynamic multi line


On Wed, Jul 2, 2014 at 10:14 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

I’ve fixed this. However this is not perfect. You will have no problem if you change a string line for another string line.

However, the following does not work:
-=-=-=-=-=-=-=-=-=-=-=-=
view := RTView new.
el := (RTLabel new text: 'Hello') element.
view add: el.
el on: TRMouseLeftClick do: [ :event | el shape text: 'Change', String cr, 'the world'; color: Color red. el update. view signalUpdate ].
view
-=-=-=-=-=-=-=-=-=-=-=-=

And this one (unfortunately) raises an error:
-=-=-=-=-=-=-=-=-=-=-=-=
view := RTView new.
el := (RTLabel new text: 'Hello', String cr, 'World') element.
view add: el.
el on: TRMouseLeftClick do: [ :event | el shape text: 'Change', String cr, 'the world'; color: Color red. el update. view signalUpdate ].
view
-=-=-=-=-=-=-=-=-=-=-=-=

A bit more work is needed for now… TRLabelShape should be probably aware of multi-lines texts.

Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 2, 2014, at 9:23 AM, Leo Perard <[hidden email]> wrote:

> Hi,
>
> I want to update the shape of an element which has an RTShape and I want to change the text.
> When I update nothing append. If I change the color it works so I think there is bug when updating the text.
>
>
> view := RTView new.
> el := (RTLabel new text: 'Hello') element.
> view add: el.
> el on: TRMouseLeftClick do: [ :event | el shape text: 'Change'; color: Color red. el update. view signalUpdate ].
> view open
>
> --
> Cheers,
> Leo Perard
> University of Lille 1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Cheers,
Leo Perard
University of Lille 1

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev