1
###############################################################################
3
# Purpose: Help with compatibility between wx versions. #
4
# Author: Cody Precord <cprecord@editra.org> #
5
# Copyright: (c) 2008 Cody Precord <staff@editra.org> #
6
# License: wxWindows License #
7
###############################################################################
10
@summary: wx Compatibility helper module
14
__author__ = "Cody Precord <cprecord@editra.org>"
15
__svnid__ = "$Id: wxcompat.py 68998 2011-09-03 22:03:32Z CJP $"
16
__revision__ = "$Revision: 68998 $"
18
#-----------------------------------------------------------------------------#
23
#-----------------------------------------------------------------------------#
25
if wx.Platform == '__WXMAC__':
26
# MacThemeColour is defined in wxPython2.9 but does not exist in 2.8
27
# This is a 2.8 version of this method.
28
if not hasattr(wx, 'MacThemeColour'):
29
def MacThemeColour(theme_id):
30
"""Get a specified Mac theme colour
31
@param theme_id: Carbon theme id
35
brush = wx.Brush(wx.BLACK)
36
brush.MacSetTheme(theme_id)
37
return brush.GetColour()
39
wx.MacThemeColour = MacThemeColour
41
wx.SystemOptions.SetOptionInt("mac.textcontrol-use-spell-checker", 1)
43
elif wx.Platform == '__WXGTK__':
44
os.environ['LIBOVERLAY_SCROLLBAR'] = '0'
46
# GetText is not available in 2.9 but GetItemLabel is not available pre 2.8.6
47
if wx.VERSION < (2, 8, 6, 0, ''):
48
wx.MenuItem.GetItemLabel = wx.MenuItem.GetText
49
wx.MenuItem.GetItemLabelText = wx.MenuItem.GetLabel