A bug has been file for this : http://www.openlaszlo.org/jira/browse/LPP-2234
Thanks Sanjaya On Tue, Jun 20, 2006 at 4:22 PM, Sanjaya Lai wrote: > I did a search in JIRA and found other potential related bug > http://www.openlaszlo.org/jira/browse/LPP-553 > > I also updated my test case to have button that modify the text and > then > set the fontsyle again... no difference found. > > The other interesting behavior is that the changes to mytext3 is > 'accumulative' of bold AND italic giving 'bolditalic' instead of just > italic. > > may be this will be fixed after fixing the LPP-553 and LPP-1223. > > Thanks. > > Sanjaya > > <canvas debug="true"> > <simplelayout /> > > <text name="mytext1" text="how come I am still bold?" > resize="true" oninit="test()"> > <method name="test"> > this.setAttribute("fontstyle","bold"); > this.setAttribute("fontstyle","plain"); > </method> > </text> > > <text name="mytext2" text="how come I am NOT OK?" resize="true" > oninit="test()"> > <method name="test"> > this.setAttribute("fontstyle","bold"); > this.setAttribute("fontstyle","plain"); > </method> > </text> > > <text name="mytext3" text="how come I am different?" > resize="true" oninit="test()"> > <method name="test"> > this.setAttribute("fontstyle","bold"); > this.setAttribute("fontstyle","italic"); > this.setAttribute("fontstyle","plain"); > </method> > </text> > > <text name="mytext4" text="this is an italic only text" > resize="true" oninit="test()"> > <method name="test"> > this.setAttribute("fontstyle","italic"); > </method> > </text> > > <text name="mytext5" text="this is a bolditalic only text" > resize="true" oninit="test()"> > <method name="test"> > this.setAttribute("fontstyle","bolditalic"); > </method> > </text> > > <button text="update texts only"> > <handler name="onclick"> > <![CDATA[ > var totButton = 3; > for (var i=1; i <= totButton; i++){ > var theButton = canvas['mytext'+i]; > theButton.setAttribute("text",theButton.text+ > "[123]"); > } > ]]> > </handler> > </button> > > <button text="update texts and fontstyle"> > <handler name="onclick"> > <![CDATA[ > var totButton = 3; > for (var i=1; i <= totButton; i++){ > var theButton = canvas['mytext'+i]; > theButton.setAttribute("text",theButton.text+ > "[abc]"); > theButton.test(); > } > ]]> > </handler> > </button> > </canvas> > >> 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: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Cloy >> Sent: Tuesday, June 20, 2006 12:23 AM >> To: [EMAIL PROTECTED] >> Cc: [email protected] >> 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 >> >> [EMAIL PROTECTED] 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 > > _______________________________________________ > Laszlo-user mailing list > [email protected] > http://www.openlaszlo.org/mailman/listinfo/laszlo-user _______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
