[Laszlo-user] text.fontstyle
David Buckler
db at intuvo.com
Tue Jun 20 12:57:14 EDT 2006
The way I got around it was to have two text boxes. One with the bold
font and then the other with the normal and then change their
visiblility when necessary. This cant work in every case and isn't
pretty but it gets the job done.
Just a thought
David
-----Original Message-----
From: laszlo-user-bounces at openlaszlo.org
[mailto:laszlo-user-bounces at openlaszlo.org] On Behalf Of Matthew Cloy
Sent: Tuesday, June 20, 2006 12:23 AM
To: slai at laszlosystems.com
Cc: laszlo-user at openlaszlo.org
Subject: Re: [Laszlo-user] text.fontstyle
This is a bug we came across too.... our workaround is to not use
fontstyle, instead we actually set and unset bold in the text string by
adding /removing <b></b> from the string in code.
It also allows other styles such as underline to be set as well.
There is a bug in JIRA about fontstyle, I would check them out...
especially perhaps this one:
http://www.openlaszlo.org/jira/browse/LPP-1223
You could try "touching" the text to get it to update, we never tested
that here.
Hope this helps
Matt
slai at laszlosystems.com wrote:
> Hi,
>
> I seem to have trouble setting fontsyle back to "plain" after changing
> to "bold" at runtime.
> I created a testcase for this question.
> I tested it in 3.1.1 it works fine, but in 3.2 [and lps-dev] it failed
> ...
>
> What did I do wrong?
> thanks.
>
> Sanjaya
> ==3.1.1/3.2 code base ==
> <canvas>
> <simplelayout />
>
> <method event="oninit">
> this.mytext1.setAttribute("fontstyle","bold");
> this.mytext1.setAttribute("fontstyle","plain");
> </method>
>
> <text name="mytext1" text="how come I am still bold?"
> resize="true"/>
>
>
> <text name="mytext2" text="how come I am OK?" resize="true">
> <method event="oninit">
> this.mytext2.setAttribute("fontstyle","bold");
> this.mytext2.setAttribute("fontstyle","plain");
> </method>
> </text>
>
> <text name="mytext3" text="how come I am NOT OK?" resize="true">
> <method event="oninit">
> this.setAttribute("fontstyle","bold");
> this.setAttribute("fontstyle","plain");
> </method>
> </text>
> </canvas>
>
>
> == 3.2 code ==
> <canvas>
> <simplelayout />
>
> <handler name="oninit">
> this.mytext1.setAttribute("fontstyle","bold");
> this.mytext1.setAttribute("fontstyle","plain");
> </handler>
>
> <text name="mytext1" text="how come I am still bold?"
> resize="true"/>
>
>
> <text name="mytext2" text="how come I am OK?" resize="true">
> <handler name="oninit">
> this.mytext2.setAttribute("fontstyle","bold");
> this.mytext2.setAttribute("fontstyle","plain");
> </handler>
> </text>
>
> <text name="mytext3" text="how come I am NOT OK?" resize="true">
> <handler name="oninit">
> this.setAttribute("fontstyle","bold");
> this.setAttribute("fontstyle","plain");
> </handler>
> </text>
> </canvas>
>
> _______________________________________________
> Laszlo-user mailing list
> Laszlo-user at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>
>
_______________________________________________
Laszlo-user mailing list
Laszlo-user at openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
More information about the Laszlo-user
mailing list