#
try:
- ##raise ImportError
+ ##raise ImportError # for testing the alternate implementation
from wx import stc
from StyledTextCtrl_2 import PythonSTC
class DemoCodeViewer(PythonSTC):
# Some methods to make it compatible with how the wxTextCtrl is used
def SetValue(self, value):
+ if wx.USE_UNICODE:
+ value = value.decode('iso8859_1')
self.SetReadOnly(False)
self.SetText(value)
self.SetReadOnly(True)
if wx.Platform != '__WXMAC__':
# setup a taskbar icon, and catch some events from it
- if wx.Platform == '__WXGTK__':
- dimension = 22
- else:
- dimension = 16
+ dim = 16 # (may want to use 22 on wxGTK, but 16b looks okay too)
icon = wx.IconFromBitmap(
- images.getMondrianImage().Scale(dimension,dimension).ConvertToBitmap() )
+ images.getMondrianImage().Scale(dim,dim).ConvertToBitmap() )
#icon = wx.Icon('bmp_source/mondrian.ico', wx.BITMAP_TYPE_ICO)
#icon = images.getMondrianIcon()
self.tbicon = wx.TaskBarIcon()
lead = text[:6]
if lead != '<html>' and lead != '<HTML>':
text = '<br>'.join(text.split('\n'))
+ if wx.USE_UNICODE:
+ text = text.decode('iso8859_1')
self.ovr.SetPage(text)
self.nb.SetPageText(0, name)