problem with SetBackgroundColour

Hello list,

I have a problem setting the background color of a TextCtrl:
a rectangle of the old color remains around the new background color. When I move the mouse over the TextCtrl this rectangle disappears.
I've tried refreshing the TextCtrl but it doesn't fixes the problem.
The only solution found is to refresh the parent of the TextCtrl but that creates a whole lot of other problems (blinking RadioBoxes)

Any ideas?

Thanks in advance
Peter.
P.S.
Win XP SP2 with wxPython 2.6.1.1pre

*From:* "Peter Damoc" <pdamoc@gmx.net>
*To:* wxPython-users@lists.wxwidgets.org
*Date:* Thu, 01 Sep 2005 11:07:41 +0300

Hello list,

I have a problem setting the background color of a TextCtrl:
a rectangle of the old color remains around the new background color.
When I move the mouse over the TextCtrl this rectangle disappears.
I've tried refreshing the TextCtrl but it doesn't fixes the problem.
The only solution found is to refresh the parent of the TextCtrl but
that creates a whole lot of other problems (blinking RadioBoxes)

Any ideas?

Thanks in advance
Peter.
P.S.
Win XP SP2 with wxPython 2.6.1.1pre

Peter, Are you using the XP 'theme' or whatever it's called, that is with
python[w].exe.manifest in your main Python directory? I can reproduce your
problem using Andrea's Script3.py when the manifest file is there. When I
remove it, the wx.TextCtrl changes from its flat appearance to a 3D look
and the band of original colour is replaced by the sunken border of the
control. Hope this helps isolate the problem - I have no idea how to solve
it though :frowning:

David

yeah, XP with themes... problem is that a refresh of the parent fixes the redraw problem... BUT is not optimal... right now I'm contemplating putting the control on a small panel only to isolate the refresh... :frowning: that kinda sucks... :frowning:

Peter.

···

On Thu, 01 Sep 2005 13:13:00 +0300, David Hughes <dfh@forestfield.co.uk> wrote:

*From:* "Peter Damoc" <pdamoc@gmx.net>
*To:* wxPython-users@lists.wxwidgets.org
*Date:* Thu, 01 Sep 2005 11:07:41 +0300

Hello list,

I have a problem setting the background color of a TextCtrl:
a rectangle of the old color remains around the new background color.
When I move the mouse over the TextCtrl this rectangle disappears.
I've tried refreshing the TextCtrl but it doesn't fixes the problem.
The only solution found is to refresh the parent of the TextCtrl but
that creates a whole lot of other problems (blinking RadioBoxes)

Any ideas?

Thanks in advance
Peter.
P.S.
Win XP SP2 with wxPython 2.6.1.1pre

Peter, Are you using the XP 'theme' or whatever it's called, that is with
python[w].exe.manifest in your main Python directory? I can reproduce your
problem using Andrea's Script3.py when the manifest file is there. When I
remove it, the wx.TextCtrl changes from its flat appearance to a 3D look
and the band of original colour is replaced by the sunken border of the
control. Hope this helps isolate the problem - I have no idea how to solve
it though :frowning:

David

*From:* "Peter Damoc" <pdamoc@gmx.net>
*To:* "wxPython Users" <wxPython-users@lists.wxwidgets.org>
*Date:* Thu, 01 Sep 2005 13:56:05 +0300

>> *From:* "Peter Damoc" <pdamoc@gmx.net>
>> *To:* wxPython-users@lists.wxwidgets.org
>> *Date:* Thu, 01 Sep 2005 11:07:41 +0300
>>
>> Hello list,
>>
>> I have a problem setting the background color of a TextCtrl:
>> a rectangle of the old color remains around the new background color.
>> When I move the mouse over the TextCtrl this rectangle disappears.
>> I've tried refreshing the TextCtrl but it doesn't fixes the problem.
>> The only solution found is to refresh the parent of the TextCtrl but
>> that creates a whole lot of other problems (blinking RadioBoxes)
>>
>> Any ideas?
>>
>> Thanks in advance
>> Peter.
>> P.S.
>> Win XP SP2 with wxPython 2.6.1.1pre
>
> Peter, Are you using the XP 'theme' or whatever it's called, that is
> with
> python[w].exe.manifest in your main Python directory? I can reproduce
> your
> problem using Andrea's Script3.py when the manifest file is there.
> When I
> remove it, the wx.TextCtrl changes from its flat appearance to a 3D
> look
> and the band of original colour is replaced by the sunken border of
> the
> control. Hope this helps isolate the problem - I have no idea how to
> solve
> it though :frowning:
>
> David

yeah, XP with themes... problem is that a refresh of the parent fixes
the redraw problem... BUT is not optimal... right now I'm
contemplating putting the control on a small panel only to isolate the
refresh... :frowning: that kinda sucks... :frowning:

Peter.

I think this should be reported as a windows-specific wxWidgets bug that
can perhaps be fixed fairly easily down in the C++ code.

Meanwhile try adding x.Hide() and x.Show() after your call to
x.SetBackgroundColour. It seems to do the trick and is probably an
acceptable work around till it is fixed.

David

···

On Thu, 01 Sep 2005 13:13:00 +0300, David Hughes > > <dfh@forestfield.co.uk wrote: