Discussion:
[Pythoncard-users] PDF Viewer
Wagner, John
2011-06-09 20:55:18 UTC
Permalink
John Henry (or anyone who can help),

I need to use the Pythoncard PDF viewer that you built. I downloaded it, put the component in the component directory, put the sample in the sample directory, but I don't know what to do with Win32com and genpy. When I run the LayoutEditor, the component shows up, but it will not load.

You stated:


1) Run win32com's genpy to activate Acrobat activeX support

2) Mod to pdfwin.py in wxPython to support Acrobat 9.0. This is not Pythoncard specific. Native wxPython needs this mod too.

3) A mod to an interface file created by win32com. Have no idea why this hack is needed because native wxPython sample program runs fine without it. Hopefully somebody that knows what's going can remove this hack.

It looks like this is something Pythoncard users are assumed to know, but it is new to me. Can you explain or point me to a resource that deals with this?

Thanks,
John W
John Henry
2011-06-11 00:50:40 UTC
Permalink
John,
Both 1 & 2 are requirements from using win32com - not Pythoncard
specific. Run the genpy program that comes with win32com and select
Acrobox active x support. #2 is Acrobat 9 related. I included a
modified version of pdfwin.py in my upload.
a) Install win32com
b) Install wxpython
c) Locate genpy.py and run it. Select Acrobat Active support.
d) Update pdfwin.py to include Acrobat 9.0 support (compair original
version with the version I uploaded and should be obvious what need to
be done).
e) Try without step 3. May be the newer version of win32com doesn't
require it any more.
Post by Wagner, John
John Henry (or anyone who can help),
I need to use the Pythoncard PDF viewer that you built. I downloaded
it, put the component in the component directory, put the sample in
the sample directory, but I don't know what to do with Win32com and
genpy. When I run the LayoutEditor, the component shows up, but it
will not load.
1)Run win32com's genpy to activate Acrobat activeX support
2) Mod to pdfwin.py in wxPython to support Acrobat 9.0. This is not
Pythoncard specific. Native wxPython needs this mod too.
3) A mod to an interface file created by win32com. Have no idea why
this hack is needed because native wxPython sample program runs fine
without it. Hopefully somebody that knows what's going can remove
this hack.
It looks like this is something Pythoncard users are assumed to know,
but it is new to me. Can you explain or point me to a resource that
deals with this?
Thanks,
John W
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--
Kim Cheung
John Henry
2011-06-16 14:18:25 UTC
Permalink
John, did it worked?
John,
Both 1 & 2 are requirements from using win32com - not Pythoncard
specific. Run the genpy program that comes with win32com and select
Acrobox active x support. #2 is Acrobat 9 related. I included a
modified version of pdfwin.py in my upload.
a) Install win32com
b) Install wxpython
c) Locate genpy.py and run it. Select Acrobat Active support.
d) Update pdfwin.py to include Acrobat 9.0 support (compair original
version with the version I uploaded and should be obvious what need to
be done).
e) Try without step 3. May be the newer version of win32com doesn't
require it any more.
Post by Wagner, John
John Henry (or anyone who can help),
I need to use the Pythoncard PDF viewer that you built. I downloaded
it, put the component in the component directory, put the sample in
the sample directory, but I don't know what to do with Win32com and
genpy. When I run the LayoutEditor, the component shows up, but it
will not load.
1)Run win32com's genpy to activate Acrobat activeX support
2) Mod to pdfwin.py in wxPython to support Acrobat 9.0. This is not
Pythoncard specific. Native wxPython needs this mod too.
3) A mod to an interface file created by win32com. Have no idea why
this hack is needed because native wxPython sample program runs fine
without it. Hopefully somebody that knows what's going can remove
this hack.
It looks like this is something Pythoncard users are assumed to know,
but it is new to me. Can you explain or point me to a resource that
deals with this?
Thanks,
John W
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--
Kim Cheung
hwg
2011-06-17 20:23:13 UTC
Permalink
Is it possible to dynamically (programatically) change the size of the font inside a Text Area?
 
I tried the following:
 
from PythonCard import model
class MainWindow(model.Background):
   def  on_Slider1_mouseUp(self, event):
       sliderValue = self.components.Slider1.value
       self.components.TextArea1.font['size'] = sliderValue
 
app = model.Application(MainWindow)
app.MainLoop()
 
When I run this and move the slider, I get the error:
 
TypeError: 'Font' object does not support item assignment.
 
 
Is there a way to do this?
 
Thanks,
hwg
John Henry
2011-06-19 13:25:19 UTC
Permalink
font is not a dictionary. It's a class. Try font._size
Post by hwg
from PythonCard import model
sliderValue = self.components.Slider1.value
self.components.TextArea1.font['size'] = sliderValue
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
hwg
2011-06-19 18:27:46 UTC
Permalink
hwg
2011-06-21 14:23:43 UTC
Permalink
Lawrence Abbott
2011-06-21 14:45:50 UTC
Permalink
hwg
2011-06-21 17:43:44 UTC
Permalink
Lawrence Abbott
2011-06-21 21:06:34 UTC
Permalink
hwg
2011-06-21 22:14:32 UTC
Permalink
Lawrence Abbott
2011-06-22 05:12:18 UTC
Permalink
hwg
2011-06-22 14:12:54 UTC
Permalink
John Henry
2011-06-21 16:46:02 UTC
Permalink
You need to post the rsrc file as well. Then others can try running the
code on their side.
Post by unknown
File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408,
in _dispatch
handler(background, aWxEvent)
File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py <http://pc_slider_text.py/>
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
sliderValue = self.components.Slider1.value
print sliderValue
font = self.components.TextArea1.font
font.SetPointSize(sliderValue)
self.components.TextArea1.SetFont(font)
print self.components.TextArea1.font
app = model.Application(MainWindow)
app.MainLoop()
------------------------------------------------------------------------
*Sent:* Monday, June 20, 2011 10:37 PM
*Subject:* Re: [Pythoncard-users] Dynamically change font size of
a TextArea
A slightly cleaner way
font = self.components.TextArea1.GetFont()
font.SetPointSize(16)
self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott
Post by unknown
Hi,
self.components.TextArea1.font_size = sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to
update either
Post by unknown
import wx
font_size =16
font1 = self.components.TextArea1.GetFont()
font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
Post by unknown
self.components.TextArea1.font_size = sliderValue
It doesn't throw an exception, but it doesn't change the font
size, either.
Post by unknown
Post by unknown
Also, oddly, the slider never seems to lose focus. It keeps
sliding back
Post by unknown
Post by unknown
and forth even after the mouse is released and no longer over
the slider. I
Post by unknown
Post by unknown
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of
a TextArea
Post by unknown
Post by unknown
font is not a dictionary. It's a class. Try font._size
from PythonCard import model
sliderValue = self.components.Slider1.value
self.components.TextArea1.font['size'] = sliderValue
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
------------------------------------------------------------------------------
Post by unknown
Post by unknown
EditLive Enterprise is the world's most technically advanced
content
Post by unknown
Post by unknown
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility
Checking.
Post by unknown
Post by unknown
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
unknown
1970-01-01 00:00:00 UTC
Permalink
--0-1994744967-1308508066=:66273
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

I tried:


self.components.TextArea1.font_size = sliderValue

It doesn't throw an exception, but it doesn't change the font size, either.  Also, oddly, the slider never seems to lose focus.  It keeps sliding back and forth even after the mouse is released and no longer over the slider.  I can't get focus on the TextArea.



- hwg
 
Post by Wagner, John
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
font is not a dictionary.  It's a class.  Try font._size
from PythonCard import model
Post by hwg
       sliderValue = self.components.Slider1.value
       self.components.TextArea1.font['size'] = sliderValue
 
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
--0-1994744967-1308508066=:66273
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>I tried:<br></span></div><div><br><span></span></div><div style="margin-left: 40px;"><span>self.components.TextArea1.font_size = sliderValue</span></div><div><br><span></span></div><div><span>It doesn't throw an exception, but it doesn't change the font size, either.&nbsp; Also, oddly, the slider never seems to lose focus.&nbsp; It keeps sliding back and forth even after the mouse is released and no longer over the slider.&nbsp; I can't get focus on the TextArea.<br></span></div><div><span><br></span></div><div><span><br></span></div><div><span>- hwg</span></div><div><span>&nbsp; </span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times,
serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> "***@gmail.com" &lt;***@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> hwg &lt;***@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> "pythoncard-***@lists.sourceforge.net" &lt;pythoncard-***@lists.sourceforge.net&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, June 18, 2011 11:45 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Pythoncard-users] Dynamically change font size of a TextArea<br></font><br>
<div id="yiv528882915">




<title></title>


font is not a dictionary.&nbsp; It's a class.&nbsp; Try font._size<br>
<br>
On 6/17/2011 1:23 PM, hwg wrote:
<blockquote type="cite">
<div style="">from PythonCard import model<br>
class MainWindow(model.Background):<br>
&nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sliderValue = self.components.Slider1.value<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.components.TextArea1.font['size'] = sliderValue<br>
&nbsp;<var id="yiv528882915yui-ie-cursor"></var><br style="">
app = model.Application(MainWindow)<br>
app.MainLoop()</div>
</blockquote>
<br>
<br>
<pre class="yiv528882915moz-signature">--
Kim Cheung</pre>


</div><br><br></div></div></blockquote></div></div></body></html>
--0-1994744967-1308508066=:66273--
unknown
1970-01-01 00:00:00 UTC
Permalink
--0-792470443-1308610561=:20580
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

That doesn't work, either.  If I print self.components.TextArea1.font after changing it, the size appears to be changing, but the actual font size in the TextArea does not change.


- hwg
Post by Wagner, John
________________________________
Sent: Monday, June 20, 2011 12:23 AM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
You are missing a dot
Post by unknown
self.components.TextArea1.font_size = sliderValue
It doesn't throw an exception, but it doesn't change the font size, either.  Also, oddly, the slider never seems to lose focus.  It keeps sliding back and forth even after the mouse is released and no longer over the slider.  I can't get focus on the TextArea.
- hwg
 
Post by Wagner, John
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
font is not a dictionary.  It's a class.  Try font._size
from PythonCard import model
Post by hwg
       sliderValue = self.components.Slider1.value
       self.components.TextArea1.font['size'] = sliderValue
 
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
--0-792470443-1308610561=:20580
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable <html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>That doesn't work, either.&nbsp; If I print self.components.TextArea1.font after changing it, the size appears to be changing, but the actual font size in the TextArea does not change.</span></div><div><br><span></span></div><div><br><span></span></div><div><span>- hwg<br></span></div><div><br><span></span></div><div><span><br></span></div><div><br><span></span></div><div><span><br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Kim Cheung &lt;***@gmail.com&gt;<br><b><span style="font-weight:
bold;">To:</span></b> hwg &lt;***@yahoo.com&gt;; pythoncard-***@lists.sourceforge.net<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, June 20, 2011 12:23 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Pythoncard-users] Dynamically change font size of a TextArea<br></font><br>
You are missing a dot<br><br><br>hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br><br>&gt;I tried:<br>&gt;<br>&gt;<br>&gt;self.components.TextArea1.font_size = sliderValue<br>&gt;<br>&gt;It doesn't throw an exception, but it doesn't change the font size, either.&nbsp; Also, oddly, the slider never seems to lose focus.&nbsp; It keeps sliding back and forth even after the mouse is released and no longer over the slider.&nbsp; I can't get focus on the TextArea.<br>&gt;<br>&gt;<br>&gt;<br>&gt;- hwg<br>&gt;&nbsp; <br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;&gt;________________________________<br>&gt;&gt;From: "<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>" &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt;To: hwg &lt;<a ymailto="mailto:***@yahoo.com"
href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt;Cc: "<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>" &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt;&gt;Sent: Saturday, June 18, 2011 11:45 PM<br>&gt;&gt;Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; font is not a dictionary.&nbsp; It's a class.&nbsp; Try font._size<br>&gt;&gt;<br>&gt;&gt;On 6/17/2011 1:23 PM, hwg wrote: <br>&gt;&gt;from PythonCard import model<br>&gt;&gt;&gt;class MainWindow(model.Background):<br>&gt;&gt;&gt;&nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sliderValue =
self.components.Slider1.value<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.components.TextArea1.font['size'] = sliderValue<br>&gt;&gt;&gt;&nbsp;<br>&gt;&gt;&gt;app = model.Application(MainWindow)<br>&gt;&gt;&gt;app.MainLoop()<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;-- <br>&gt;Kim Cheung<br>&gt;&gt;<br>&gt;&gt;<br><br></div></div></blockquote></div></div></body></html>
--0-792470443-1308610561=:20580--
unknown
1970-01-01 00:00:00 UTC
Permalink
--0-1112063886-1308666223=:18781
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

I tried both of the methods below:

I get the following error:

Traceback (most recent call last):
 File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in _dispatch
handler(background, aWxEvent)
 File "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py", line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'


Here's the complete code:

# pc_slider_text.py
# try to change the size of text font in a test box using a slider


from wx import *
from PythonCard import model
class MainWindow(model.Background):
    def  on_Slider1_mouseUp(self, event):
        sliderValue = self.components.Slider1.value
        print sliderValue
        font = self.components.TextArea1.font
        font.SetPointSize(sliderValue)
        self.components.TextArea1.SetFont(font)
        print self.components.TextArea1.font

app = model.Application(MainWindow)
app.MainLoop()
Post by Wagner, John
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
A slightly cleaner way
        font = self.components.TextArea1.GetFont()
        font.SetPointSize(16)
        self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Post by unknown
Hi,
self.components.TextArea1.font_size = sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update either
import wx
font_size =16
font1 = self.components.TextArea1.GetFont()
font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
Post by unknown
self.components.TextArea1.font_size = sliderValue
It doesn't throw an exception, but it doesn't change the font size, either.
Also, oddly, the slider never seems to lose focus.  It keeps sliding back
and forth even after the mouse is released and no longer over the slider.  I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
font is not a dictionary.  It's a class.  Try font._size
from PythonCard import model
       sliderValue = self.components.Slider1.value
       self.components.TextArea1.font['size'] = sliderValue
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--0-1112063886-1308666223=:18781
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div>I tried both of the methods below:</div><div><br></div><div>I get the following error:</div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><br></div><div><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">Traceback (most recent call last):</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in _dispatch</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">handler(background, aWxEvent)</span><br style="font-family:Courier New, courier, monaco, monospace,
sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;File "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py", line 11, in on_Slider1_mouseUp</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">font.SetPointSize(sliderValue)</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">AttributeError: 'Font' object has no attribute 'SetPointSize'</span><br></div><div><br></div><div>Here's the complete code:</div><div><br></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;"># <a target="_blank" href="http://pc_slider_text.py/"><span class="yshortcuts" id="lw_1308666021_0">pc_slider_text.py</span></a><br># try to change the size of text font in
a test box using a slider<br><br></div><div><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">from wx import *</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">from PythonCard import model</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">class MainWindow(model.Background):</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sliderValue =
self.components.Slider1.value</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print sliderValue</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font = self.components.TextArea1.font</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font.SetPointSize(sliderValue)</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.components.TextArea1.SetFont(font)</span><br
style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; print self.components.TextArea1.font</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;"></span></div><div><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><br></span></div><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">a</span><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">pp = model.Application(MainWindow)</span><br style="font-family:Courier New, courier, monaco, monospace, sans-serif;"><span style="font-family:Courier New, courier, monaco, monospace, sans-serif;">app.MainLoop()</span><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new
york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Lawrence Abbott &lt;***@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> hwg &lt;***@yahoo.com&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, June 20, 2011 10:37 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Pythoncard-users] Dynamically change font size of a TextArea<br></font><br>
A slightly cleaner way<br><br>&nbsp; &nbsp; &nbsp; &nbsp; font = self.components.TextArea1.GetFont()<br>&nbsp; &nbsp; &nbsp; &nbsp; font.SetPointSize(16)<br>&nbsp; &nbsp; &nbsp; &nbsp; self.components.TextArea1.SetFont(font)<br><br>Cheers,<br>Lawrie<br><br>On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt; wrote:<br>&gt; Hi,<br>&gt;<br>&gt; self.components.TextArea1.font_size = sliderValue<br>&gt;<br>&gt; doesnt work for me<br>&gt;<br>&gt; print self.components.TextArea1.font.size<br>&gt;<br>&gt; gives a dictionary of font attributes, but I can't get them to update either<br>&gt;<br>&gt; import wx<br>&gt;<br>&gt; font_size =16<br>&gt;<br>&gt; font1 = self.components.TextArea1.GetFont()<br>&gt; font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)<br>&gt; self.components.TextArea1.SetFont( font2 )<br>&gt;<br>&gt; seems to work<br>&gt;<br>&gt;
HTH,<br>&gt; Lawrie<br>&gt;<br>&gt; On Mon, Jun 20, 2011 at 2:27 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt; I tried:<br>&gt;&gt;<br>&gt;&gt; self.components.TextArea1.font_size = sliderValue<br>&gt;&gt; It doesn't throw an exception, but it doesn't change the font size, either.<br>&gt;&gt; Also, oddly, the slider never seems to lose focus.&nbsp; It keeps sliding back<br>&gt;&gt; and forth even after the mouse is released and no longer over the slider.&nbsp; I<br>&gt;&gt; can't get focus on the TextArea.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; - hwg<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; From: "<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>" &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt; To: hwg &lt;<a
ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt; Cc: "<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>"<br>&gt;&gt; &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt;&gt; Sent: Saturday, June 18, 2011 11:45 PM<br>&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;&gt;<br>&gt;&gt; font is not a dictionary.&nbsp; It's a class.&nbsp; Try font._size<br>&gt;&gt;<br>&gt;&gt; On 6/17/2011 1:23 PM, hwg wrote:<br>&gt;&gt;<br>&gt;&gt; from PythonCard import model<br>&gt;&gt; class MainWindow(model.Background):<br>&gt;&gt; &nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sliderValue =
self.components.Slider1.value<br>&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.components.TextArea1.font['size'] = sliderValue<br>&gt;&gt;<br>&gt;&gt; app = model.Application(MainWindow)<br>&gt;&gt; app.MainLoop()<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt; Kim Cheung<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ------------------------------------------------------------------------------<br>&gt;&gt; EditLive Enterprise is the world's most technically advanced content<br>&gt;&gt; authoring tool. Experience the power of Track Changes, Inline Image<br>&gt;&gt; Editing and ensure content is compliant with Accessibility Checking.<br>&gt;&gt; http://p.sf.net/sfu/ephox-dev2dev<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Pythoncard-users mailing list<br>&gt;&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net" href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt;&gt; <a
href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br><br><br></div></div></blockquote></div></div></body></html>
--0-1112063886-1308666223=:18781--
unknown
1970-01-01 00:00:00 UTC
Permalink
try
font =3D self.components.TextArea1.GetFont()

instead of
font =3D self.components.TextArea1.font

also you will need to ensure the slider output values are legitimate font s=
izes
also should be no need to import wx with SetPointSize method

Cheers,
Lawrie
=A0File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, i=
n
_dispatch
handler(background, aWxEvent)
=A0File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_=
text.py",
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
=A0=A0=A0 =A0=A0=A0 sliderValue =3D self.components.Slider1.value
=A0=A0=A0 =A0=A0=A0 print sliderValue
=A0=A0=A0 =A0=A0=A0 font =3D self.components.TextArea1.font
=A0=A0=A0 =A0=A0=A0 font.SetPointSize(sliderValue)
=A0=A0=A0 =A0=A0=A0 self.components.TextArea1.SetFont(font)
=A0=A0=A0 =A0=A0=A0 print self.components.TextArea1.font
app =3D model.Application(MainWindow)
app.MainLoop()
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextAre=
a
A slightly cleaner way
=A0 =A0 =A0 =A0 font =3D self.components.TextArea1.GetFont()
=A0 =A0 =A0 =A0 font.SetPointSize(16)
=A0 =A0 =A0 =A0 self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Hi,
self.components.TextArea1.font_size =3D sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update
either
import wx
font_size =3D16
font1 =3D self.components.TextArea1.GetFont()
font2 =3D wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
self.components.TextArea1.font_size =3D sliderValue
It doesn't throw an exception, but it doesn't change the font size,
either.
Also, oddly, the slider never seems to lose focus.=A0 It keeps sliding =
back
and forth even after the mouse is released and no longer over the
slider.=A0 I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
font is not a dictionary.=A0 It's a class.=A0 Try font._size
from PythonCard import model
=A0=A0=A0=A0=A0=A0 sliderValue =3D self.components.Slider1.value
=A0=A0=A0=A0=A0=A0=A0self.components.TextArea1.font['size'] =3D sliderV=
alue
app =3D model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
-----------------------------------------------------------------------=
-------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
-------------------------------------------------------------------------=
-----
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
Lawrence Abbott
1970-01-01 00:00:00 UTC
Permalink
--0-429441989-1308678224=:55592
Content-Type: multipart/alternative; boundary="0-1412455963-1308678224=:55592"

--0-1412455963-1308678224=:55592
Content-Type: text/plain; charset=us-ascii

Lawrie,

That works. Thanks!

I still have a weird issue where the Slider doesn't give up focus. I start
dragging it, and when I release it (mouseUp), the event handler fires and the
font size changes. But I can't enter the TextArea, and the slider still moves
around as I move the mouse, even with no mouse buttons pressed. I can't access
the TextArea or the Menu, and I can't even close the PythonCard app window
without going into the IDE and stopping the script from there.

Any idea what's causing this?

Complete code is attached.


Thanks,
hwg





________________________________
From: Lawrence Abbott <***@gmail.com>
To: hwg <***@yahoo.com>
Cc: pythoncard-users <pythoncard-***@lists.sourceforge.net>
Sent: Tue, June 21, 2011 7:45:50 AM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea

try
font = self.components.TextArea1.GetFont()

instead of
font = self.components.TextArea1.font

also you will need to ensure the slider output values are legitimate font sizes
also should be no need to import wx with SetPointSize method

Cheers,
Lawrie
Post by unknown
File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in
_dispatch
handler(background, aWxEvent)
File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",
,
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
sliderValue = self.components.Slider1.value
print sliderValue
font = self.components.TextArea1.font
font.SetPointSize(sliderValue)
self.components.TextArea1.SetFont(font)
print self.components.TextArea1.font
app = model.Application(MainWindow)
app.MainLoop()
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
A slightly cleaner way
font = self.components.TextArea1.GetFont()
font.SetPointSize(16)
self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Post by unknown
Hi,
self.components.TextArea1.font_size = sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update
either
import wx
font_size =16
font1 = self.components.TextArea1.GetFont()
font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
Post by unknown
self.components.TextArea1.font_size = sliderValue
It doesn't throw an exception, but it doesn't change the font size,
either.
Also, oddly, the slider never seems to lose focus. It keeps sliding back
and forth even after the mouse is released and no longer over the
slider. I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
font is not a dictionary. It's a class. Try font._size
from PythonCard import model
sliderValue = self.components.Slider1.value
self.components.TextArea1.font['size'] = sliderValue
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
------------------------------------------------------------------------------
Post by unknown
Post by unknown
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--0-1412455963-1308678224=:55592
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:10pt"><div>Lawrie,<br><br>That works.&nbsp; Thanks!<br><br>I still have a weird issue where the Slider doesn't give up focus.&nbsp; I start dragging it, and when I release it (mouseUp), the event handler fires and the font size changes.&nbsp; But I can't enter the TextArea, and the slider still moves around as I move the mouse, even with no mouse buttons pressed.&nbsp; I can't access the TextArea or the Menu, and I can't even close the PythonCard app window without going into the IDE and stopping the script from there.<br><br>Any idea what's causing this?<br><br>Complete code is attached.<br><br><br>Thanks,<br>hwg<br><br></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><br><div style="font-family:arial, helvetica,
sans-serif;font-size:10pt"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Lawrence Abbott &lt;***@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> hwg &lt;***@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> pythoncard-users &lt;pythoncard-***@lists.sourceforge.net&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, June 21, 2011 7:45:50 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Pythoncard-users] Dynamically change font size of a TextArea<br></font><br>
try<br>font = self.components.TextArea1.GetFont()<br><br>instead of<br>font = self.components.TextArea1.font<br><br>also you will need to ensure the slider output values are legitimate font sizes<br>also should be no need to import wx with SetPointSize method<br><br>Cheers,<br>Lawrie<br><br><br>On Tue, Jun 21, 2011 at 10:23 PM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt; I tried both of the methods below:<br>&gt; I get the following error:<br>&gt; Traceback (most recent call last):<br>&gt; &nbsp;File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in<br>&gt; _dispatch<br>&gt; handler(background, aWxEvent)<br>&gt; &nbsp;File<br>&gt; "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",<br>&gt; line 11, in on_Slider1_mouseUp<br>&gt; font.SetPointSize(sliderValue)<br>&gt; AttributeError: 'Font' object has no attribute
'SetPointSize'<br>&gt;<br>&gt; Here's the complete code:<br>&gt; # <a target="_blank" href="http://pc_slider_text.py">pc_slider_text.py</a><br>&gt; # try to change the size of text font in a test box using a slider<br>&gt;<br>&gt; from wx import *<br>&gt; from PythonCard import model<br>&gt; class MainWindow(model.Background):<br>&gt; &nbsp;&nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sliderValue = self.components.Slider1.value<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print sliderValue<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font = self.components.TextArea1.font<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font.SetPointSize(sliderValue)<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.components.TextArea1.SetFont(font)<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print self.components.TextArea1.font<br>&gt;<br>&gt; app = model.Application(MainWindow)<br>&gt;
app.MainLoop()<br>&gt;<br>&gt; ________________________________<br>&gt; From: Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt; Sent: Monday, June 20, 2011 10:37 PM<br>&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;<br>&gt; A slightly cleaner way<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; font = self.components.TextArea1.GetFont()<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; font.SetPointSize(16)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; self.components.TextArea1.SetFont(font)<br>&gt;<br>&gt; Cheers,<br>&gt; Lawrie<br>&gt;<br>&gt; On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt; wrote:<br>&gt;&gt; Hi,<br>&gt;&gt;<br>&gt;&gt;
self.components.TextArea1.font_size = sliderValue<br>&gt;&gt;<br>&gt;&gt; doesnt work for me<br>&gt;&gt;<br>&gt;&gt; print self.components.TextArea1.font.size<br>&gt;&gt;<br>&gt;&gt; gives a dictionary of font attributes, but I can't get them to update<br>&gt;&gt; either<br>&gt;&gt;<br>&gt;&gt; import wx<br>&gt;&gt;<br>&gt;&gt; font_size =16<br>&gt;&gt;<br>&gt;&gt; font1 = self.components.TextArea1.GetFont()<br>&gt;&gt; font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)<br>&gt;&gt; self.components.TextArea1.SetFont( font2 )<br>&gt;&gt;<br>&gt;&gt; seems to work<br>&gt;&gt;<br>&gt;&gt; HTH,<br>&gt;&gt; Lawrie<br>&gt;&gt;<br>&gt;&gt; On Mon, Jun 20, 2011 at 2:27 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt;&gt; I tried:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; self.components.TextArea1.font_size = sliderValue<br>&gt;&gt;&gt; It doesn't throw an exception, but it doesn't
change the font size,<br>&gt;&gt;&gt; either.<br>&gt;&gt;&gt; Also, oddly, the slider never seems to lose focus.&nbsp; It keeps sliding back<br>&gt;&gt;&gt; and forth even after the mouse is released and no longer over the<br>&gt;&gt;&gt; slider.&nbsp; I<br>&gt;&gt;&gt; can't get focus on the TextArea.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; - hwg<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; ________________________________<br>&gt;&gt;&gt; From: "<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>" &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt;&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt;&gt; Cc: "<a ymailto="mailto:pythoncard-***@lists.sourceforge.net"
href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>"<br>&gt;&gt;&gt; &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt;&gt;&gt; Sent: Saturday, June 18, 2011 11:45 PM<br>&gt;&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a<br>&gt;&gt;&gt; TextArea<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; font is not a dictionary.&nbsp; It's a class.&nbsp; Try font._size<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On 6/17/2011 1:23 PM, hwg wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; from PythonCard import model<br>&gt;&gt;&gt; class MainWindow(model.Background):<br>&gt;&gt;&gt; &nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sliderValue = self.components.Slider1.value<br>&gt;&gt;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.components.TextArea1.font['size'] = sliderValue<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; app = model.Application(MainWindow)<br>&gt;&gt;&gt; app.MainLoop()<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; --<br>&gt;&gt;&gt; Kim Cheung<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; ------------------------------------------------------------------------------<br>&gt;&gt;&gt; EditLive Enterprise is the world's most technically advanced content<br>&gt;&gt;&gt; authoring tool. Experience the power of Track Changes, Inline Image<br>&gt;&gt;&gt; Editing and ensure content is compliant with Accessibility Checking.<br><span>&gt;&gt;&gt; <a target="_blank" href="http://p.sf.net/sfu/ephox-dev2dev">http://p.sf.net/sfu/ephox-dev2dev</a></span><br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Pythoncard-users mailing list<br>&gt;&gt;&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net"
href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt;&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------------<br>&gt; EditLive Enterprise is the world's most technically advanced content<br>&gt; authoring tool. Experience the power of Track Changes, Inline Image<br>&gt; Editing and ensure content is compliant with Accessibility Checking.<br>&gt; <a href="http://p.sf.net/sfu/ephox-dev2dev" target="_blank">http://p.sf.net/sfu/ephox-dev2dev</a><br>&gt; _______________________________________________<br>&gt; Pythoncard-users mailing list<br>&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net"
href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt; <a href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;<br>&gt;<br></div></div>



</div></body></html>
--0-1412455963-1308678224=:55592--
--0-429441989-1308678224=:55592
Content-Type: application/octet-stream; name="pc_slider_text.py"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="pc_slider_text.py"

IyBwY19zbGlkZXJfdGV4dC5weQojIHRyeSB0byBjaGFuZ2UgdGhlIHNpemUg
b2YgdGV4dCBmb250IGluIGEgdGV4dCBib3ggdXNpbmcgYSBzbGlkZXIKCmZy
b20gd3ggaW1wb3J0ICoKZnJvbSBQeXRob25DYXJkIGltcG9ydCBtb2RlbApj
bGFzcyBNYWluV2luZG93KG1vZGVsLkJhY2tncm91bmQpOgoJZGVmICBvbl9T
bGlkZXIxX21vdXNlVXAoc2VsZiwgZXZlbnQpOgoJCXNsaWRlclZhbHVlID0g
c2VsZi5jb21wb25lbnRzLlNsaWRlcjEudmFsdWUKCQlmb250ID0gc2VsZi5j
b21wb25lbnRzLlRleHRBcmVhMS5HZXRGb250KCkKCQlmb250LlNldFBvaW50
U2l6ZShzbGlkZXJWYWx1ZSkKCQlzZWxmLmNvbXBvbmVudHMuVGV4dEFyZWEx
LlNldEZvbnQoZm9udCkKCQphcHAgPSBtb2RlbC5BcHBsaWNhdGlvbihNYWlu
V2luZG93KQphcHAuTWFpbkxvb3AoKQoKCgo=

--0-429441989-1308678224=:55592
Content-Type: application/octet-stream; name="pc_slider_text.rsrc.py"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="pc_slider_text.rsrc.py"

eydhcHBsaWNhdGlvbic6eyd0eXBlJzonQXBwbGljYXRpb24nLA0KICAgICAg
ICAgICduYW1lJzonVGVtcGxhdGUnLA0KICAgICdiYWNrZ3JvdW5kcyc6IFsN
CiAgICB7J3R5cGUnOidCYWNrZ3JvdW5kJywNCiAgICAgICAgICAnbmFtZSc6
J2JnVGVtcGxhdGUnLA0KICAgICAgICAgICd0aXRsZSc6J1N0YW5kYXJkIFRl
bXBsYXRlIHdpdGggRmlsZS0+RXhpdCBtZW51JywNCiAgICAgICAgICAnc2l6
ZSc6KDQwMCwgMzAwKSwNCiAgICAgICAgICAnc3R5bGUnOlsncmVzaXplYWJs
ZSddLA0KDQogICAgICAgICdtZW51YmFyJzogeyd0eXBlJzonTWVudUJhcics
DQogICAgICAgICAnbWVudXMnOiBbDQogICAgICAgICAgICAgeyd0eXBlJzon
TWVudScsDQogICAgICAgICAgICAgJ25hbWUnOidtZW51RmlsZScsDQogICAg
ICAgICAgICAgJ2xhYmVsJzonJkZpbGUnLA0KICAgICAgICAgICAgICdpdGVt
cyc6IFsNCiAgICAgICAgICAgICAgICAgIHsndHlwZSc6J01lbnVJdGVtJywN
CiAgICAgICAgICAgICAgICAgICAnbmFtZSc6J21lbnVGaWxlRXhpdCcsDQog
ICAgICAgICAgICAgICAgICAgJ2xhYmVsJzonRSZ4aXQnLA0KICAgICAgICAg
ICAgICAgICAgICdjb21tYW5kJzonZXhpdCcsDQogICAgICAgICAgICAgICAg
ICB9LA0KICAgICAgICAgICAgICBdDQogICAgICAgICAgICAgfSwNCiAgICAg
ICAgIF0NCiAgICAgfSwNCiAgICAgICAgICdjb21wb25lbnRzJzogWw0KDQp7
J3R5cGUnOidTbGlkZXInLCANCiAgICAnbmFtZSc6J1NsaWRlcjEnLCANCiAg
ICAncG9zaXRpb24nOig1OSwgMTczKSwgDQogICAgJ3NpemUnOig5OCwgMzEp
LCANCiAgICAnbGFiZWxzJzpGYWxzZSwgDQogICAgJ2xheW91dCc6J2hvcml6
b250YWwnLCANCiAgICAnbWF4Jzo1MCwgDQogICAgJ21pbic6NCwgDQogICAg
J3RpY2tGcmVxdWVuY3knOjAsIA0KICAgICd0aWNrcyc6RmFsc2UsIA0KICAg
ICd2YWx1ZSc6NCwgDQogICAgfSwNCg0Keyd0eXBlJzonVGV4dEFyZWEnLCAN
CiAgICAnbmFtZSc6J1RleHRBcmVhMScsIA0KICAgICdwb3NpdGlvbic6KDE5
LCAyMSksIA0KICAgICdzaXplJzooMjY1LCAxMTQpLCANCiAgICAndGV4dCc6
dSdUZXh0QXJlYTEnLCANCiAgICB9LA0KDQpdICMgZW5kIGNvbXBvbmVudHMN
Cn0gIyBlbmQgYmFja2dyb3VuZA0KXSAjIGVuZCBiYWNrZ3JvdW5kcw0KfSB9
DQo=
unknown
1970-01-01 00:00:00 UTC
Permalink
Try adding an

event.Skip()

As mentioned previously - no need for the wx import.

Cheers,
Lawrie
Post by Lawrence Abbott
Lawrie,
That works.=A0 Thanks!
I still have a weird issue where the Slider doesn't give up focus.=A0 I s=
tart
Post by Lawrence Abbott
dragging it, and when I release it (mouseUp), the event handler fires and
the font size changes.=A0 But I can't enter the TextArea, and the slider =
still
Post by Lawrence Abbott
moves around as I move the mouse, even with no mouse buttons pressed.=A0 =
I
Post by Lawrence Abbott
can't access the TextArea or the Menu, and I can't even close the PythonC=
ard
Post by Lawrence Abbott
app window without going into the IDE and stopping the script from there.
Any idea what's causing this?
Complete code is attached.
Thanks,
hwg
________________________________
Sent: Tue, June 21, 2011 7:45:50 AM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextAre=
a
Post by Lawrence Abbott
try
font =3D self.components.TextArea1.GetFont()
instead of
font =3D self.components.TextArea1.font
also you will need to ensure the slider output values are legitimate font
sizes
also should be no need to import wx with SetPointSize method
Cheers,
Lawrie
=A0File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, =
in
Post by Lawrence Abbott
_dispatch
handler(background, aWxEvent)
=A0File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider=
_text.py",
Post by Lawrence Abbott
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
=A0=A0=A0 =A0=A0=A0 sliderValue =3D self.components.Slider1.value
=A0=A0=A0 =A0=A0=A0 print sliderValue
=A0=A0=A0 =A0=A0=A0 font =3D self.components.TextArea1.font
=A0=A0=A0 =A0=A0=A0 font.SetPointSize(sliderValue)
=A0=A0=A0 =A0=A0=A0 self.components.TextArea1.SetFont(font)
=A0=A0=A0 =A0=A0=A0 print self.components.TextArea1.font
app =3D model.Application(MainWindow)
app.MainLoop()
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextAr=
ea
Post by Lawrence Abbott
A slightly cleaner way
=A0 =A0 =A0 =A0 font =3D self.components.TextArea1.GetFont()
=A0 =A0 =A0 =A0 font.SetPointSize(16)
=A0 =A0 =A0 =A0 self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Hi,
self.components.TextArea1.font_size =3D sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update
either
import wx
font_size =3D16
font1 =3D self.components.TextArea1.GetFont()
font2 =3D wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
self.components.TextArea1.font_size =3D sliderValue
It doesn't throw an exception, but it doesn't change the font size,
either.
Also, oddly, the slider never seems to lose focus.=A0 It keeps sliding
back
and forth even after the mouse is released and no longer over the
slider.=A0 I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
font is not a dictionary.=A0 It's a class.=A0 Try font._size
from PythonCard import model
=A0=A0=A0=A0=A0=A0 sliderValue =3D self.components.Slider1.value
=A0=A0=A0=A0=A0=A0=A0self.components.TextArea1.font['size'] =3D slider=
Value
Post by Lawrence Abbott
app =3D model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
----------------------------------------------------------------------=
--------
Post by Lawrence Abbott
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
------------------------------------------------------------------------=
------
Post by Lawrence Abbott
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
unknown
1970-01-01 00:00:00 UTC
Permalink
--0-1303499748-1308694472=:98706
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

That's what I needed.  Working perfectly now.  (I also removed the unnecessary wx import.)

I don't understand why I need the event.Skip().  If someone could explain, it would be much appreciated.


hwg
Post by Wagner, John
________________________________
Sent: Tuesday, June 21, 2011 2:06 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
Try adding an
event.Skip()
As mentioned previously - no need for the wx import.
Cheers,
Lawrie
Post by Lawrence Abbott
Lawrie,
That works.  Thanks!
I still have a weird issue where the Slider doesn't give up focus.  I start
dragging it, and when I release it (mouseUp), the event handler fires and
the font size changes.  But I can't enter the TextArea, and the slider still
moves around as I move the mouse, even with no mouse buttons pressed.  I
can't access the TextArea or the Menu, and I can't even close the PythonCard
app window without going into the IDE and stopping the script from there.
Any idea what's causing this?
Complete code is attached.
Thanks,
hwg
________________________________
Sent: Tue, June 21, 2011 7:45:50 AM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
try
font = self.components.TextArea1.GetFont()
instead of
font = self.components.TextArea1.font
also you will need to ensure the slider output values are legitimate font
sizes
also should be no need to import wx with SetPointSize method
Cheers,
Lawrie
Post by unknown
 File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in
_dispatch
handler(background, aWxEvent)
 File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
        sliderValue = self.components.Slider1.value
        print sliderValue
        font = self.components.TextArea1.font
        font.SetPointSize(sliderValue)
        self.components.TextArea1.SetFont(font)
        print self.components.TextArea1.font
app = model.Application(MainWindow)
app.MainLoop()
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
A slightly cleaner way
        font = self.components.TextArea1.GetFont()
        font.SetPointSize(16)
        self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Post by unknown
Hi,
self.components.TextArea1.font_size = sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update
either
import wx
font_size =16
font1 = self.components.TextArea1.GetFont()
font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
Post by unknown
self.components.TextArea1.font_size = sliderValue
It doesn't throw an exception, but it doesn't change the font size,
either.
Also, oddly, the slider never seems to lose focus.  It keeps sliding
back
and forth even after the mouse is released and no longer over the
slider.  I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
font is not a dictionary.  It's a class.  Try font._size
from PythonCard import model
       sliderValue = self.components.Slider1.value
       self.components.TextArea1.font['size'] = sliderValue
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--0-1303499748-1308694472=:98706
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable <html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>That's what I needed.&nbsp; Working perfectly now.&nbsp; (I also removed the unnecessary wx import.)</span></div><div><br><span></span></div><div><span>I don't understand why I need the event.Skip().&nbsp; If someone could explain, it would be much appreciated.</span></div><div><br><span></span></div><div><br><span></span></div><div><span>hwg</span></div><div><span><br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Lawrence Abbott &lt;***@gmail.com&gt;<br><b><span
style="font-weight: bold;">To:</span></b> hwg &lt;***@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> pythoncard-users &lt;pythoncard-***@lists.sourceforge.net&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, June 21, 2011 2:06 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Pythoncard-users] Dynamically change font size of a TextArea<br></font><br>
Try adding an<br><br>event.Skip()<br><br>As mentioned previously - no need for the wx import.<br><br>Cheers,<br>Lawrie<br><br>On Wed, Jun 22, 2011 at 1:43 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt; Lawrie,<br>&gt;<br>&gt; That works.&nbsp; Thanks!<br>&gt;<br>&gt; I still have a weird issue where the Slider doesn't give up focus.&nbsp; I start<br>&gt; dragging it, and when I release it (mouseUp), the event handler fires and<br>&gt; the font size changes.&nbsp; But I can't enter the TextArea, and the slider still<br>&gt; moves around as I move the mouse, even with no mouse buttons pressed.&nbsp; I<br>&gt; can't access the TextArea or the Menu, and I can't even close the PythonCard<br>&gt; app window without going into the IDE and stopping the script from there.<br>&gt;<br>&gt; Any idea what's causing this?<br>&gt;<br>&gt; Complete code is attached.<br>&gt;<br>&gt;<br>&gt;
Thanks,<br>&gt; hwg<br>&gt;<br>&gt;<br>&gt; ________________________________<br>&gt; From: Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt; Cc: pythoncard-users &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt; Sent: Tue, June 21, 2011 7:45:50 AM<br>&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;<br>&gt; try<br>&gt; font = self.components.TextArea1.GetFont()<br>&gt;<br>&gt; instead of<br>&gt; font = self.components.TextArea1.font<br>&gt;<br>&gt; also you will need to ensure the slider output values are legitimate font<br>&gt; sizes<br>&gt; also should be no need to import wx with SetPointSize
method<br>&gt;<br>&gt; Cheers,<br>&gt; Lawrie<br>&gt;<br>&gt;<br>&gt; On Tue, Jun 21, 2011 at 10:23 PM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt; I tried both of the methods below:<br>&gt;&gt; I get the following error:<br>&gt;&gt; Traceback (most recent call last):<br>&gt;&gt; &nbsp;File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in<br>&gt;&gt; _dispatch<br>&gt;&gt; handler(background, aWxEvent)<br>&gt;&gt; &nbsp;File<br>&gt;&gt;<br>&gt;&gt; "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",<br>&gt;&gt; line 11, in on_Slider1_mouseUp<br>&gt;&gt; font.SetPointSize(sliderValue)<br>&gt;&gt; AttributeError: 'Font' object has no attribute 'SetPointSize'<br>&gt;&gt;<br>&gt;&gt; Here's the complete code:<br>&gt;&gt; # <a target="_blank" href="http://pc_slider_text.py">pc_slider_text.py</a><br>&gt;&gt; # try to change the size of
text font in a test box using a slider<br>&gt;&gt;<br>&gt;&gt; from wx import *<br>&gt;&gt; from PythonCard import model<br>&gt;&gt; class MainWindow(model.Background):<br>&gt;&gt; &nbsp;&nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sliderValue = self.components.Slider1.value<br>&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print sliderValue<br>&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font = self.components.TextArea1.font<br>&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font.SetPointSize(sliderValue)<br>&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.components.TextArea1.SetFont(font)<br>&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print self.components.TextArea1.font<br>&gt;&gt;<br>&gt;&gt; app = model.Application(MainWindow)<br>&gt;&gt; app.MainLoop()<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; From: Lawrence Abbott &lt;<a
ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt; Sent: Monday, June 20, 2011 10:37 PM<br>&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;&gt;<br>&gt;&gt; A slightly cleaner way<br>&gt;&gt;<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; font = self.components.TextArea1.GetFont()<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; font.SetPointSize(16)<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; self.components.TextArea1.SetFont(font)<br>&gt;&gt;<br>&gt;&gt; Cheers,<br>&gt;&gt; Lawrie<br>&gt;&gt;<br>&gt;&gt; On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt; wrote:<br>&gt;&gt;&gt; Hi,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; self.components.TextArea1.font_size =
sliderValue<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; doesnt work for me<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; print self.components.TextArea1.font.size<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; gives a dictionary of font attributes, but I can't get them to update<br>&gt;&gt;&gt; either<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; import wx<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; font_size =16<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; font1 = self.components.TextArea1.GetFont()<br>&gt;&gt;&gt; font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)<br>&gt;&gt;&gt; self.components.TextArea1.SetFont( font2 )<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; seems to work<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; HTH,<br>&gt;&gt;&gt; Lawrie<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On Mon, Jun 20, 2011 at 2:27 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt;&gt;&gt; I tried:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; self.components.TextArea1.font_size =
sliderValue<br>&gt;&gt;&gt;&gt; It doesn't throw an exception, but it doesn't change the font size,<br>&gt;&gt;&gt;&gt; either.<br>&gt;&gt;&gt;&gt; Also, oddly, the slider never seems to lose focus.&nbsp; It keeps sliding<br>&gt;&gt;&gt;&gt; back<br>&gt;&gt;&gt;&gt; and forth even after the mouse is released and no longer over the<br>&gt;&gt;&gt;&gt; slider.&nbsp; I<br>&gt;&gt;&gt;&gt; can't get focus on the TextArea.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; - hwg<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; ________________________________<br>&gt;&gt;&gt;&gt; From: "<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>" &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt;&gt;&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt;&gt;&gt; Cc: "<a
ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>"<br>&gt;&gt;&gt;&gt; &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt;&gt;&gt;&gt; Sent: Saturday, June 18, 2011 11:45 PM<br>&gt;&gt;&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a<br>&gt;&gt;&gt;&gt; TextArea<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; font is not a dictionary.&nbsp; It's a class.&nbsp; Try font._size<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; On 6/17/2011 1:23 PM, hwg wrote:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; from PythonCard import model<br>&gt;&gt;&gt;&gt; class MainWindow(model.Background):<br>&gt;&gt;&gt;&gt; &nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sliderValue =
self.components.Slider1.value<br>&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.components.TextArea1.font['size'] = sliderValue<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; app = model.Application(MainWindow)<br>&gt;&gt;&gt;&gt; app.MainLoop()<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; --<br>&gt;&gt;&gt;&gt; Kim Cheung<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; ------------------------------------------------------------------------------<br>&gt;&gt;&gt;&gt; EditLive Enterprise is the world's most technically advanced content<br>&gt;&gt;&gt;&gt; authoring tool. Experience the power of Track Changes, Inline Image<br>&gt;&gt;&gt;&gt; Editing and ensure content is compliant with Accessibility Checking.<br>&gt;&gt;&gt;&gt; http://p.sf.net/sfu/ephox-dev2dev<br>&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt; Pythoncard-users mailing list<br>&gt;&gt;&gt;&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net" href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt;&gt;&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ------------------------------------------------------------------------------<br>&gt;&gt; EditLive Enterprise is the world's most technically advanced content<br>&gt;&gt; authoring tool. Experience the power of Track Changes, Inline Image<br>&gt;&gt; Editing and ensure content is compliant with Accessibility Checking.<br>&gt;&gt; <a href="http://p.sf.net/sfu/ephox-dev2dev" target="_blank">http://p.sf.net/sfu/ephox-dev2dev</a><br>&gt;&gt; _______________________________________________<br>&gt;&gt; Pythoncard-users
mailing list<br>&gt;&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net" href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br><br><br></div></div></blockquote></div></div></body></html>
--0-1303499748-1308694472=:98706--
unknown
1970-01-01 00:00:00 UTC
Permalink
On-line documentation is going to do a more thorough and accurate job
than I can do :( ....try these

http://wiki.wxpython.org/EventPropagation
http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind

remembering PythonCard is a wrapper of wxpython

Cheers,
Lawrie
That's what I needed.=A0 Working perfectly now.=A0 (I also removed the
unnecessary wx import.)
I don't understand why I need the event.Skip().=A0 If someone could expla=
in,
it would be much appreciated.
hwg
________________________________
Sent: Tuesday, June 21, 2011 2:06 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextAre=
a
Try adding an
event.Skip()
As mentioned previously - no need for the wx import.
Cheers,
Lawrie
Post by Lawrence Abbott
Lawrie,
That works.=A0 Thanks!
I still have a weird issue where the Slider doesn't give up focus.=A0 I
start
dragging it, and when I release it (mouseUp), the event handler fires an=
d
Post by Lawrence Abbott
the font size changes.=A0 But I can't enter the TextArea, and the slider
still
moves around as I move the mouse, even with no mouse buttons pressed.=A0=
I
Post by Lawrence Abbott
can't access the TextArea or the Menu, and I can't even close the
PythonCard
app window without going into the IDE and stopping the script from there=
.
Post by Lawrence Abbott
Any idea what's causing this?
Complete code is attached.
Thanks,
hwg
________________________________
Sent: Tue, June 21, 2011 7:45:50 AM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextAr=
ea
Post by Lawrence Abbott
try
font =3D self.components.TextArea1.GetFont()
instead of
font =3D self.components.TextArea1.font
also you will need to ensure the slider output values are legitimate fon=
t
Post by Lawrence Abbott
sizes
also should be no need to import wx with SetPointSize method
Cheers,
Lawrie
=A0File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408,=
in
Post by Lawrence Abbott
_dispatch
handler(background, aWxEvent)
=A0File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slide=
r_text.py",
Post by Lawrence Abbott
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
=A0=A0=A0 =A0=A0=A0 sliderValue =3D self.components.Slider1.value
=A0=A0=A0 =A0=A0=A0 print sliderValue
=A0=A0=A0 =A0=A0=A0 font =3D self.components.TextArea1.font
=A0=A0=A0 =A0=A0=A0 font.SetPointSize(sliderValue)
=A0=A0=A0 =A0=A0=A0 self.components.TextArea1.SetFont(font)
=A0=A0=A0 =A0=A0=A0 print self.components.TextArea1.font
app =3D model.Application(MainWindow)
app.MainLoop()
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
A slightly cleaner way
=A0 =A0 =A0 =A0 font =3D self.components.TextArea1.GetFont()
=A0 =A0 =A0 =A0 font.SetPointSize(16)
=A0 =A0 =A0 =A0 self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Hi,
self.components.TextArea1.font_size =3D sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update
either
import wx
font_size =3D16
font1 =3D self.components.TextArea1.GetFont()
font2 =3D wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
self.components.TextArea1.font_size =3D sliderValue
It doesn't throw an exception, but it doesn't change the font size,
either.
Also, oddly, the slider never seems to lose focus.=A0 It keeps slidin=
g
Post by Lawrence Abbott
back
and forth even after the mouse is released and no longer over the
slider.=A0 I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
font is not a dictionary.=A0 It's a class.=A0 Try font._size
from PythonCard import model
=A0=A0=A0=A0=A0=A0 sliderValue =3D self.components.Slider1.value
=A0=A0=A0=A0=A0=A0=A0self.components.TextArea1.font['size'] =3D slide=
rValue
Post by Lawrence Abbott
app =3D model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
---------------------------------------------------------------------=
---------
Post by Lawrence Abbott
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
-----------------------------------------------------------------------=
-------
Post by Lawrence Abbott
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
unknown
1970-01-01 00:00:00 UTC
Permalink
--0-2063283643-1308751974=:79510
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks.  The help is much appreciated!


hwg
Post by Wagner, John
________________________________
Sent: Tuesday, June 21, 2011 10:12 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
On-line documentation is going to do a more thorough and accurate  job
than I can do :( ....try these
http://wiki.wxpython.org/EventPropagation
http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind
remembering PythonCard is a wrapper of wxpython
Cheers,
Lawrie
Post by unknown
That's what I needed.  Working perfectly now.  (I also removed the
unnecessary wx import.)
I don't understand why I need the event.Skip().  If someone could explain,
it would be much appreciated.
hwg
________________________________
Sent: Tuesday, June 21, 2011 2:06 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
Try adding an
event.Skip()
As mentioned previously - no need for the wx import.
Cheers,
Lawrie
Post by Lawrence Abbott
Lawrie,
That works.  Thanks!
I still have a weird issue where the Slider doesn't give up focus.  I
start
dragging it, and when I release it (mouseUp), the event handler fires and
the font size changes.  But I can't enter the TextArea, and the slider
still
moves around as I move the mouse, even with no mouse buttons pressed.  I
can't access the TextArea or the Menu, and I can't even close the
PythonCard
app window without going into the IDE and stopping the script from there.
Any idea what's causing this?
Complete code is attached.
Thanks,
hwg
________________________________
Sent: Tue, June 21, 2011 7:45:50 AM
Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea
try
font = self.components.TextArea1.GetFont()
instead of
font = self.components.TextArea1.font
also you will need to ensure the slider output values are legitimate font
sizes
also should be no need to import wx with SetPointSize method
Cheers,
Lawrie
Post by unknown
 File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in
_dispatch
handler(background, aWxEvent)
 File
"C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",
line 11, in on_Slider1_mouseUp
font.SetPointSize(sliderValue)
AttributeError: 'Font' object has no attribute 'SetPointSize'
# pc_slider_text.py
# try to change the size of text font in a test box using a slider
from wx import *
from PythonCard import model
        sliderValue = self.components.Slider1.value
        print sliderValue
        font = self.components.TextArea1.font
        font.SetPointSize(sliderValue)
        self.components.TextArea1.SetFont(font)
        print self.components.TextArea1.font
app = model.Application(MainWindow)
app.MainLoop()
________________________________
Sent: Monday, June 20, 2011 10:37 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
A slightly cleaner way
        font = self.components.TextArea1.GetFont()
        font.SetPointSize(16)
        self.components.TextArea1.SetFont(font)
Cheers,
Lawrie
Post by unknown
Hi,
self.components.TextArea1.font_size = sliderValue
doesnt work for me
print self.components.TextArea1.font.size
gives a dictionary of font attributes, but I can't get them to update
either
import wx
font_size =16
font1 = self.components.TextArea1.GetFont()
font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)
self.components.TextArea1.SetFont( font2 )
seems to work
HTH,
Lawrie
Post by unknown
self.components.TextArea1.font_size = sliderValue
It doesn't throw an exception, but it doesn't change the font size,
either.
Also, oddly, the slider never seems to lose focus.  It keeps sliding
back
and forth even after the mouse is released and no longer over the
slider.  I
can't get focus on the TextArea.
- hwg
________________________________
Sent: Saturday, June 18, 2011 11:45 PM
Subject: Re: [Pythoncard-users] Dynamically change font size of a
TextArea
font is not a dictionary.  It's a class.  Try font._size
from PythonCard import model
       sliderValue = self.components.Slider1.value
       self.components.TextArea1.font['size'] = sliderValue
app = model.Application(MainWindow)
app.MainLoop()
--
Kim Cheung
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
------------------------------------------------------------------------------
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
_______________________________________________
Pythoncard-users mailing list
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--0-2063283643-1308751974=:79510
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable <html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>Thanks.&nbsp; The help is much appreciated!</span></div><div><br><span></span></div><div><span></span></div><div>hwg</div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Lawrence Abbott &lt;***@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> hwg &lt;***@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> pythoncard-users &lt;pythoncard-***@lists.sourceforge.net&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, June 21,
2011 10:12 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Pythoncard-users] Dynamically change font size of a TextArea<br></font><br>
On-line documentation is going to do a more thorough and accurate&nbsp; job<br>than I can do :( ....try these<br><br>http://wiki.wxpython.org/EventPropagation<br>http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind<br><br>remembering PythonCard is a wrapper of wxpython<br><br>Cheers,<br>Lawrie<br><br>On Wed, Jun 22, 2011 at 6:14 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt; That's what I needed.&nbsp; Working perfectly now.&nbsp; (I also removed the<br>&gt; unnecessary wx import.)<br>&gt; I don't understand why I need the event.Skip().&nbsp; If someone could explain,<br>&gt; it would be much appreciated.<br>&gt;<br>&gt; hwg<br>&gt;<br>&gt; ________________________________<br>&gt; From: Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com"
href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt; Cc: pythoncard-users &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt; Sent: Tuesday, June 21, 2011 2:06 PM<br>&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;<br>&gt; Try adding an<br>&gt;<br>&gt; event.Skip()<br>&gt;<br>&gt; As mentioned previously - no need for the wx import.<br>&gt;<br>&gt; Cheers,<br>&gt; Lawrie<br>&gt;<br>&gt; On Wed, Jun 22, 2011 at 1:43 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt; Lawrie,<br>&gt;&gt;<br>&gt;&gt; That works.&nbsp; Thanks!<br>&gt;&gt;<br>&gt;&gt; I still have a weird issue where the Slider doesn't give up focus.&nbsp; I<br>&gt;&gt; start<br>&gt;&gt; dragging it, and when I release it (mouseUp), the event handler
fires and<br>&gt;&gt; the font size changes.&nbsp; But I can't enter the TextArea, and the slider<br>&gt;&gt; still<br>&gt;&gt; moves around as I move the mouse, even with no mouse buttons pressed.&nbsp; I<br>&gt;&gt; can't access the TextArea or the Menu, and I can't even close the<br>&gt;&gt; PythonCard<br>&gt;&gt; app window without going into the IDE and stopping the script from there.<br>&gt;&gt;<br>&gt;&gt; Any idea what's causing this?<br>&gt;&gt;<br>&gt;&gt; Complete code is attached.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; Thanks,<br>&gt;&gt; hwg<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; From: Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt; Cc: pythoncard-users &lt;<a
ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt;&gt; Sent: Tue, June 21, 2011 7:45:50 AM<br>&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea<br>&gt;&gt;<br>&gt;&gt; try<br>&gt;&gt; font = self.components.TextArea1.GetFont()<br>&gt;&gt;<br>&gt;&gt; instead of<br>&gt;&gt; font = self.components.TextArea1.font<br>&gt;&gt;<br>&gt;&gt; also you will need to ensure the slider output values are legitimate font<br>&gt;&gt; sizes<br>&gt;&gt; also should be no need to import wx with SetPointSize method<br>&gt;&gt;<br>&gt;&gt; Cheers,<br>&gt;&gt; Lawrie<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; On Tue, Jun 21, 2011 at 10:23 PM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt;&gt; I tried both of the methods below:<br>&gt;&gt;&gt; I get the following
error:<br>&gt;&gt;&gt; Traceback (most recent call last):<br>&gt;&gt;&gt; &nbsp;File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in<br>&gt;&gt;&gt; _dispatch<br>&gt;&gt;&gt; handler(background, aWxEvent)<br>&gt;&gt;&gt; &nbsp;File<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py",<br>&gt;&gt;&gt; line 11, in on_Slider1_mouseUp<br>&gt;&gt;&gt; font.SetPointSize(sliderValue)<br>&gt;&gt;&gt; AttributeError: 'Font' object has no attribute 'SetPointSize'<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Here's the complete code:<br>&gt;&gt;&gt; # <a target="_blank" href="http://pc_slider_text.py">pc_slider_text.py</a><br>&gt;&gt;&gt; # try to change the size of text font in a test box using a slider<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; from wx import *<br>&gt;&gt;&gt; from PythonCard import model<br>&gt;&gt;&gt; class MainWindow(model.Background):<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;
def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sliderValue = self.components.Slider1.value<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print sliderValue<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font = self.components.TextArea1.font<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; font.SetPointSize(sliderValue)<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.components.TextArea1.SetFont(font)<br>&gt;&gt;&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print self.components.TextArea1.font<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; app = model.Application(MainWindow)<br>&gt;&gt;&gt; app.MainLoop()<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; ________________________________<br>&gt;&gt;&gt; From: Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt;&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com"
href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt;&gt; Sent: Monday, June 20, 2011 10:37 PM<br>&gt;&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a<br>&gt;&gt;&gt; TextArea<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; A slightly cleaner way<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; font = self.components.TextArea1.GetFont()<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; font.SetPointSize(16)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; self.components.TextArea1.SetFont(font)<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Cheers,<br>&gt;&gt;&gt; Lawrie<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt;&gt; wrote:<br>&gt;&gt;&gt;&gt; Hi,<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; self.components.TextArea1.font_size = sliderValue<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; doesnt work for
me<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; print self.components.TextArea1.font.size<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; gives a dictionary of font attributes, but I can't get them to update<br>&gt;&gt;&gt;&gt; either<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; import wx<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; font_size =16<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; font1 = self.components.TextArea1.GetFont()<br>&gt;&gt;&gt;&gt; font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight)<br>&gt;&gt;&gt;&gt; self.components.TextArea1.SetFont( font2 )<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; seems to work<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; HTH,<br>&gt;&gt;&gt;&gt; Lawrie<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; On Mon, Jun 20, 2011 at 2:27 AM, hwg &lt;<a ymailto="mailto:***@yahoo.com" href="mailto:***@yahoo.com">***@yahoo.com</a>&gt; wrote:<br>&gt;&gt;&gt;&gt;&gt; I tried:<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;
self.components.TextArea1.font_size = sliderValue<br>&gt;&gt;&gt;&gt;&gt; It doesn't throw an exception, but it doesn't change the font size,<br>&gt;&gt;&gt;&gt;&gt; either.<br>&gt;&gt;&gt;&gt;&gt; Also, oddly, the slider never seems to lose focus.&nbsp; It keeps sliding<br>&gt;&gt;&gt;&gt;&gt; back<br>&gt;&gt;&gt;&gt;&gt; and forth even after the mouse is released and no longer over the<br>&gt;&gt;&gt;&gt;&gt; slider.&nbsp; I<br>&gt;&gt;&gt;&gt;&gt; can't get focus on the TextArea.<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; - hwg<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; ________________________________<br>&gt;&gt;&gt;&gt;&gt; From: "<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>" &lt;<a ymailto="mailto:***@gmail.com" href="mailto:***@gmail.com">***@gmail.com</a>&gt;<br>&gt;&gt;&gt;&gt;&gt; To: hwg &lt;<a ymailto="mailto:***@yahoo.com"
href="mailto:***@yahoo.com">***@yahoo.com</a>&gt;<br>&gt;&gt;&gt;&gt;&gt; Cc: "<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>"<br>&gt;&gt;&gt;&gt;&gt; &lt;<a ymailto="mailto:pythoncard-***@lists.sourceforge.net" href="mailto:pythoncard-***@lists.sourceforge.net">pythoncard-***@lists.sourceforge.net</a>&gt;<br>&gt;&gt;&gt;&gt;&gt; Sent: Saturday, June 18, 2011 11:45 PM<br>&gt;&gt;&gt;&gt;&gt; Subject: Re: [Pythoncard-users] Dynamically change font size of a<br>&gt;&gt;&gt;&gt;&gt; TextArea<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; font is not a dictionary.&nbsp; It's a class.&nbsp; Try font._size<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; On 6/17/2011 1:23 PM, hwg wrote:<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; from PythonCard import model<br>&gt;&gt;&gt;&gt;&gt; class
MainWindow(model.Background):<br>&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp; def&nbsp; on_Slider1_mouseUp(self, event):<br>&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sliderValue = self.components.Slider1.value<br>&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.components.TextArea1.font['size'] = sliderValue<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; app = model.Application(MainWindow)<br>&gt;&gt;&gt;&gt;&gt; app.MainLoop()<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; --<br>&gt;&gt;&gt;&gt;&gt; Kim Cheung<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; ------------------------------------------------------------------------------<br>&gt;&gt;&gt;&gt;&gt; EditLive Enterprise is the world's most technically advanced content<br>&gt;&gt;&gt;&gt;&gt; authoring tool. Experience the power of Track Changes, Inline
Image<br>&gt;&gt;&gt;&gt;&gt; Editing and ensure content is compliant with Accessibility Checking.<br>&gt;&gt;&gt;&gt;&gt; http://p.sf.net/sfu/ephox-dev2dev<br>&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt;&gt; Pythoncard-users mailing list<br>&gt;&gt;&gt;&gt;&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net" href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt;&gt;&gt;&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; ------------------------------------------------------------------------------<br>&gt;&gt;&gt; EditLive Enterprise is the world's most technically advanced
content<br>&gt;&gt;&gt; authoring tool. Experience the power of Track Changes, Inline Image<br>&gt;&gt;&gt; Editing and ensure content is compliant with Accessibility Checking.<br>&gt;&gt;&gt; <a href="http://p.sf.net/sfu/ephox-dev2dev" target="_blank">http://p.sf.net/sfu/ephox-dev2dev</a><br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Pythoncard-users mailing list<br>&gt;&gt;&gt; <a ymailto="mailto:Pythoncard-***@lists.sourceforge.net" href="mailto:Pythoncard-***@lists.sourceforge.net">Pythoncard-***@lists.sourceforge.net</a><br>&gt;&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt;<br><br><br></div></div></blockquote></div></div></body></html>
--0-2063283643-1308751974=:79510--

Continue reading on narkive:
Loading...