[wxpython-users] Re: Font for the demo sources
Mike Driscoll
mdriscoll at co.marshall.ia.us
Thu May 1 12:32:37 PDT 2008
Mikhail wrote:
> Mike Driscoll <mdriscoll <at> co.marshall.ia.us> writes:
>
>
>>>
>>>
>> If you don't want to do it programmatically, I'd recommend just holding
>> CTRL and using your scroll wheel.
>>
>>
>
> Thanks, I always forget about this way, but I actually meant the programmatic
> way. The reason I'm asking is that when I change the default font size in my
> environment (KDE) then this change is propagated to the wxPython demo
> application (as one would expect) except the font size in the "Demo Code" panel.
> I think it would be a good idea to make demo more 'well behaved app' :0)
>
>
>
Well, looking at the code (in Main.py of the Demo folder), it looks like
the "Demo Code" panel uses the StyledTextCtrl_2 unless there's an import
error at which it switches to using a standard TextCtrl. If you look at
the demo for StyledTextCtrl_2, you'll notice that they set the size
using the following (I think) on line 134:
self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
"face:%(helv)s,size:%(size)d" % faces)
I would think you could do the same. They continue using this command
for quite a few lines after that too.
TextCtrls appear to have a SetStyle method in the demo. I've never done
this before and it might only apply to the TextCtrls that have RichText
style applied to them. But I think this will give you a starting place.
Mike
More information about the wxpython-users
mailing list