[wxPython-users] Bitmap text only writes in black under Linux

Steve Holden steve at holdenweb.com
Fri Jun 16 06:36:06 PDT 2006


Robin Dunn wrote:
> Steve Holden wrote:
[...]
> What version are you using?  This works for me with 2.6.3.2, (running in 
> a PyShell):
> 
>  >>> import wx
>  >>> f = wx.Frame(None)
>  >>> p = wx.Panel(f)
>  >>> f.Show()
>  True
>  >>> b = wx.EmptyBitmap(200,100)
>  >>> dc = wx.MemoryDC()
>  >>> dc.SelectObject(b)
>  >>> dc.SetBackground(wx.Brush("black"))
>  >>> dc.Clear()
>  >>> dc.SetTextForeground(wx.Colour(173, 216, 230))
>  >>> dc.GetTextExtent("Hello Steve")
>  (94, 19)
>  >>> dc.DrawText("Hello Steve", 10,10)
>  >>> dc.SelectObject(wx.NullBitmap)
>  >>> sb = wx.StaticBitmap(p, -1, b, (20,20))
>  >>>
> 

Happy to report that modelling my code after yours gave successful 
results. My Linux fonts (as seen on www.holdenweb.org) don't appear to 
have quite the quality of the Windows ones (www.holdenweb.com), but 
overall I'm getting closer to where I need to be.

Next: MercilessRefactoring ...

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Love me, love my blog  http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the wxpython-users mailing list