Changing font size in a control?

Hi,

I should preface my remarks by saying I'm both a Python and wxPython
newbie, so the answer to this may be as plain as the nose on my face.
However, I've looked as much as I could through the documentation and
couldn't find a way to do this, so here goes:

Is there any way to change the size of a font used in a control?

I'm subclassing CheckListBox under wxPythonGTK 2.4.2.4 (python version
2.2) and the font used for each element in the resulting check box is
very small. I was hoping to find a way to increase the size of the
text in the box, via some work with a wxDC/wxFont, but I can't see any
way to specify a particular font for use in the checkbox elements.

Which rather leads me to the assumption that there is no way to do so
(perhaps it's tied to the native widget set?) but I'd nevertheless like
to try to do this.

Any ideas? Or am I right in assuming this can't be done?

Thanks,

···

--
    - Don Waugaman (dpw@cs.arizona.edu) O- _|_ Will pun
Web Page: http://www.cs.arizona.edu/people/dpw/ | for food
In the Sonoran Desert, where we say: "It's a dry heat..." | <><
You want to know where you can get a hold of Mrs. Potter? I don't know,
she's awfully ticklish. -- Groucho Marx

Don

I am also a newbie, but this works for a button - so you can try it there.
Let me know how it goes.

1. wxCheckBox is a subclass of wxWindow
2. wxWindow has a SetFont method. Therefore so does wxCheckBox.
3. It takes a wxFont parameter
4. See wxFont::wxFont in the help file for more.

Mike

···

----- Original Message -----
From: "Don Waugaman" <dpw@CS.Arizona.EDU>
To: <wxPython-users@lists.wxwindows.org>
Sent: Sunday, October 26, 2003 1:34 PM
Subject: [wxPython-users] Changing font size in a control?

Hi,

I should preface my remarks by saying I'm both a Python and wxPython
newbie, so the answer to this may be as plain as the nose on my face.
However, I've looked as much as I could through the documentation and
couldn't find a way to do this, so here goes:

Is there any way to change the size of a font used in a control?

I'm subclassing CheckListBox under wxPythonGTK 2.4.2.4 (python version
2.2) and the font used for each element in the resulting check box is
very small. I was hoping to find a way to increase the size of the
text in the box, via some work with a wxDC/wxFont, but I can't see any
way to specify a particular font for use in the checkbox elements.

Which rather leads me to the assumption that there is no way to do so
(perhaps it's tied to the native widget set?) but I'd nevertheless like
to try to do this.

Any ideas? Or am I right in assuming this can't be done?

Thanks,
--
    - Don Waugaman (dpw@cs.arizona.edu) O- _|_ Will pun
Web Page: Directory | Computer Science | for food
In the Sonoran Desert, where we say: "It's a dry heat..." | <><
You want to know where you can get a hold of Mrs. Potter? I don't know,
she's awfully ticklish. -- Groucho Marx

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Hi Mike,

Works like a charm (except for ugly fonts, which aren't wxPython's
fault). Thanks for the help!

···

On Sun, Oct 26, 2003 at 09:09:24PM +1300, Mike Edmonds wrote:

Don

I am also a newbie, but this works for a button - so you can try it there.
Let me know how it goes.

1. wxCheckBox is a subclass of wxWindow
2. wxWindow has a SetFont method. Therefore so does wxCheckBox.
3. It takes a wxFont parameter
4. See wxFont::wxFont in the help file for more.

Mike

--
    - Don Waugaman (dpw@cs.arizona.edu) O- _|_ Will pun
Web Page: Directory | Computer Science | for food
In the Sonoran Desert, where we say: "It's a dry heat..." | <><
"Very funny, Scotty. Now beam down my clothes."