TextCtrl SetBackgroundColour Doesnt work

http://pastebin.com/z9r43y0L

Try that example, then press the “Save” button.

A red frame around the TextCtrl will still be there. I do not want this red frame. Does anyone know how to fix this?

Platform and version? Have you tried doing the Refresh on the parent?

···

On 9/1/12 7:56 AM, Waffle wrote:

http://pastebin.com/z9r43y0L

Try that example, then press the "Save" button.

A red frame around the TextCtrl will still be there. I do not want this
red frame. Does anyone know how to fix this?

--
Robin Dunn
Software Craftsman

Robin Dunn wrote:

···

On 9/1/12 7:56 AM, Waffle wrote:

http://pastebin.com/z9r43y0L

Try that example, then press the "Save" button.

A red frame around the TextCtrl will still be there. I do not want this
red frame. Does anyone know how to fix this?

Platform and version? Have you tried doing the Refresh on the parent?

That does solve the problem, by the way. Change
    self.editname.Refresh()
to
    self.Refresh()

Apparently, the outer border of the frame is considered the
responsibility of the parent, not of the edit box.

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

I think it is a matter of client area vs. whole widget, and the native text control applying the wx Refresh() to just the client area. When the parent is refreshed then it causes all of the children to refresh also and in that case the native text control is getting the right message to do a total refresh. A possible optimization would be to use the parent's RefreshRect passing the child's GetRect value.

···

On 9/4/12 11:21 AM, Tim Roberts wrote:

Robin Dunn wrote:

On 9/1/12 7:56 AM, Waffle wrote:

http://pastebin.com/z9r43y0L

Try that example, then press the "Save" button.

A red frame around the TextCtrl will still be there. I do not want this
red frame. Does anyone know how to fix this?

Platform and version? Have you tried doing the Refresh on the parent?

That does solve the problem, by the way. Change
     self.editname.Refresh()
to
     self.Refresh()

Apparently, the outer border of the frame is considered the
responsibility of the parent, not of the edit box.

--
Robin Dunn
Software Craftsman