I have created a button with left justified label (see code),.
When the background coloumr of the button is changed,
the label is not left justified any more
Well, that smells like a bug to me. What OS and wxPython version? By
the way, the native button's on some platforms do not honor background
or foreground colors all the time. In fact, I've heard that they'll
sometimes ignore those methods depending on what theme is enabled.
I didn't find a generic button that allowed text alignment though, so
you may have to roll your own.
···
On Jul 30, 3:19 pm, Ilan <f28p...@gmail.com> wrote:
Hi every body
I'm new here...
I have created a button with left justified label (see code),.
When the background coloumr of the button is changed,
the label is not left justified any more
I have created a button with left justified label (see code),.
When the background coloumr of the button is changed,
the label is not left justified any more
When you change the color of a native button on MSW then it goes into "owner-drawn" mode, meaning that wx is doing the drawing of the button instead of Microsoft. My guess is that wx code simply does not pay attention to the alignment flags.
Mike Driscoll wrote:
I didn't find a generic button that allowed text alignment though, so
you may have to roll your own.
Alignment support can be added to the generic button classes by overriding the DrawLabel button in a derived class and drawing the label however you want.