[wxPython-users] wx.ListBox: SetBackgroundColour and SetFont

Raffaello Barella barbarossa.platz at gmail.com
Mon Feb 25 12:51:26 PST 2008


Is it correct to understand that this behavior (as far as the cell's
attributes are concerned) will apply to practically all kind of control in a
cell editor?

Meanwhile, all my thanks.

2008/2/25, Robin Dunn <robin at alldunn.com>:
>
> Raffaello Barella wrote:
> > The instructions that do not work are in the lines 90-95. Many thanks
> again.
>
>
> It does work the first time, but you can't see it because of a logic
> error in your code.  The self.height hasn't been set yet when you try to
> use it in SetSize so you resize the edit control to be almost invisible.
>      The attributes are being reset on subsequent showings because the
> grid has code in place to set the edit control's attributes to match the
> cell's font and color attributes.  You can override this behavior by
> overriding the editor's Show method, like this:
>
>      def Show(self, show, attr):
>          self.choice.Show(show)
>          font =3D self.choice.Parent.GetFont()
>          font.SetStyle(wx.FONTSTYLE_ITALIC)
>          self.choice.SetFont(font)
>          self.choice.SetBackgroundColour(wx.Colour(223, 223, 223))
>
>
> --
>
> Robin Dunn
> Software Craftsman
> http://wxPython.org  Java give you jitters?  Relax with wxPython!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200802=
25/f7942f4e/attachment.htm


More information about the wxpython-users mailing list