It's up to the native widget whether it does anything with Set[Back|Fore]groundColour, and as far as I know none of the platforms do for wx.StaticLine. You can do it with a generic control where you draw the lines yourself.
···
On 2/24/10 5:23 AM, R. P. Hintze wrote:
I apologize in advance for what for another newbie (and probably dumb)
question...
If I have a wx.StaticLine, is it possible to control its color?
Yes, I was playing around with Set[Back|Fore]groundColour (I am using
WindowsXP), and the color of the wx.StaticLine does not change.
I will look into how one draws a line...
As a practical exercise (in learning python and wxpython), I am trying
to write a program that my little girl can use to learn/re-enforce
math facts. The program will show random "problems" - such as, "13 +
6" - as a statictext, and she will enter the answer (key pad will be
displayed for mouse or she can use keyboard). I wanted the "problem"
to be presented as:
13
+ 6
With the " 6" underlined and with a text control beneath the underline
for her to enter her answer. I have formatted the "problem" with the
following code:
In the actual program, self.num_one and self.num_two will be randomly
generated. I am struggling on how to add the underline. I guess I
could break self.num_one and self.num_two into 2 statictext widgets,
and apply a different font to self.num_two - which set "underline" as
"TRUE"? I thought that there should be an easier way.
···
On Feb 24, 8:31 pm, Robin Dunn <ro...@alldunn.com> wrote:
It's up to the native widget whether it does anything with
Set[Back|Fore]groundColour, and as far as I know none of the platforms
do for wx.StaticLine. You can do it with a generic control where you
draw the lines yourself.
You could use a small HtmlWindow. That would give you quite a few more
options, although it doesn't support advanced HTML or CSS, you could
do a one column table along with <u/> or whatever.
Alternatively, you might look at some of the styled text controls,
like RichTextCtrl or StyleTextCtrl.
···
On Feb 25, 6:24 am, gatoruss <rphin...@earthlink.net> wrote:
On Feb 24, 8:31 pm, Robin Dunn <ro...@alldunn.com> wrote:
> It's up to the native widget whether it does anything with
> Set[Back|Fore]groundColour, and as far as I know none of the platforms
> do for wx.StaticLine. You can do it with a generic control where you
> draw the lines yourself.
Yes, I was playing around with Set[Back|Fore]groundColour (I am using
WindowsXP), and the color of the wx.StaticLine does not change.
I will look into how one draws a line...
As a practical exercise (in learning python and wxpython), I am trying
to write a program that my little girl can use to learn/re-enforce
math facts. The program will show random "problems" - such as, "13 +
6" - as a statictext, and she will enter the answer (key pad will be
displayed for mouse or she can use keyboard). I wanted the "problem"
to be presented as:
13
+ 6
With the " 6" underlined and with a text control beneath the underline
for her to enter her answer. I have formatted the "problem" with the
following code:
In the actual program, self.num_one and self.num_two will be randomly
generated. I am struggling on how to add the underline. I guess I
could break self.num_one and self.num_two into 2 statictext widgets,
and apply a different font to self.num_two - which set "underline" as
"TRUE"? I thought that there should be an easier way.