Created
September 23, 2015 20:31
-
-
Save LeeKamentsky/11eb5d9ad099622dc7d1 to your computer and use it in GitHub Desktop.
Mac selection snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if sys.platform != 'darwin': | |
wx.RendererNative.Get().DrawItemSelectionRect( | |
window, dc, rect, flags) | |
elif flags & wx.CONTROL_SELECTED: | |
if flags & wx.CONTROL_FOCUSED: | |
color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT) | |
else: | |
color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_INACTIVECAPTION) | |
old_brush = dc.Brush | |
new_brush = wx.Brush(color) | |
dc.Brush = new_brush | |
dc.Pen = wx.TRANSPARENT_PEN | |
dc.DrawRectangleRect(rect) | |
dc.Brush = old_brush | |
new_brush.Destroy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment