Christopher Barker wrote:
> 
> Paul McNett wrote:
>> I've been using FloatCanvas for 2 years now to draw a visual of a 
>> manufactured product. Each component going into the product can be 
>> clicked on by the user, and from their they can change dimensions and 
>> other properties. Couldn't be much slicker, and I'm really happy.
> 
> glad to hear it!
> 
>> However, Mac has these really juicy backgrounds like the alternating 
>> grey/silver stripes,
> 
> I've noticed this, and have had issues with another app as well. We 
> never solved it there, actually. WE used to blit the background from the 
> clientDC after clearing, but the Mac no longer allows that, and you're 
> right, if you draw nothing, it doesn't properly clear the background.
> 
> I think what's missing is a call to the Mac Window system telling it to 
> clear the Window and restore the nifty background -- I'm pretty sure 
> ClientDC.Clear() ( or PaintDC.Clear() ) will only paint the background 
> color, of, if that is none or transparent, it doesn't do anything.


You can paint with the themed background by using a special brush.  See 
wx/lib/stattext.py for an example.  In 2.8 it's something like this:

             if wx.Platform == "__WXMAC__":
                 backBrush.MacSetTheme(kThemeBrushDialogBackgroundActive)


In 2.9 it will change and be a bit better integrated, and something like 
this will do it:

             if wx.Platform == "__WXMAC__":
                 themeColour = 
wx.MacThemeColour(kThemeBrushDialogBackgroundActive)
                 backBrush = wx.Brush(themeColour)

You can get the theme constant like this:

     if wx.Platform == "__WXMAC__":
         from Carbon.Appearance import kThemeBrushDialogBackgroundActive


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!

_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to