Dynamically change font size of a TextArea
hwg <[email protected]> Fri, 17 Jun 2011 13:23:13 -0700 (PDT)
| Newsgroups | gmane.comp.python.pythoncard |
|---|---|
| Message-ID | <[email protected]> |
--===============1656187694259988078== Content-Type: multipart/alternative; boundary="0-624661915-1308342193=:31461" --0-624661915-1308342193=:31461 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Is it possible to dynamically (programatically) change the size of the font= inside a Text Area?=0A=A0=0AI tried the following:=0A=A0=0Afrom PythonCard= import model=0Aclass MainWindow(model.Background):=0A=A0=A0 def=A0 on_Slid= er1_mouseUp(self, event):=0A=A0=A0=A0=A0=A0=A0 sliderValue =3D self.compone= nts.Slider1.value=0A=A0=A0=A0=A0=A0=A0=A0self.components.TextArea1.font['si= ze'] =3D sliderValue=0A=A0=0Aapp =3D model.Application(MainWindow)=0Aapp.Ma= inLoop()=0A=A0=0AWhen I run this and move the slider, I get the error:=0A= =A0=0ATypeError: 'Font' object does not support item assignment.=0A=A0=0A= =A0=0AIs there a way to do this?=0A=A0=0AThanks,=0Ahwg --0-624661915-1308342193=:31461 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"color:#000; background-color:#fff; font-family:Co= urier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div styl= e=3D"RIGHT: auto"><FONT style=3D"RIGHT: auto" face=3D"arial, helvetica, san= s-serif">Is it possible to dynamically (programatically) change the size of= the font inside a Text Area?</FONT></div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif"></FO= NT> </div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif">I tr= ied the following:</FONT></div> <div style=3D"RIGHT: auto"> </div> <div style=3D"RIGHT: auto">from PythonCard import model<BR>class MainWindow= (model.Background):<BR> def on_Slider1_mouseUp(self, even= t):<BR> sliderValue =3D self.components= .Slider1.value<BR> self.components= .TextArea1.font['size'] =3D sliderValue<BR> <VAR id=3Dyui-ie-cursor></= VAR><BR style=3D"RIGHT: auto">app =3D model.Application(MainWindow)<BR>app.= MainLoop()</div> <div style=3D"RIGHT: auto"> </div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif">When= I run this and move the slider, I get the error:</FONT></div> <div style=3D"RIGHT: auto"> </div> <div style=3D"RIGHT: auto">TypeError: 'Font' object does not support item a= ssignment.</div> <div style=3D"RIGHT: auto"> </div> <div style=3D"RIGHT: auto"><FONT style=3D"RIGHT: auto" face=3D"arial, helve= tica, sans-serif"></FONT> </div> <div style=3D"RIGHT: auto"><FONT style=3D"RIGHT: auto" face=3D"arial, helve= tica, sans-serif">Is there a way to do this?</FONT></div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif"></FO= NT> </div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif">Than= ks,</FONT></div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif">hwg<= /FONT></div> <div style=3D"RIGHT: auto"><FONT face=3D"arial, helvetica, sans-serif"></FO= NT> </div> <div style=3D"RIGHT: auto"> </div></div></body></html> --0-624661915-1308342193=:31461-- --===============1656187694259988078== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev --===============1656187694259988078== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Pythoncard-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pythoncard-users --===============1656187694259988078==--