I am writing a class in wxPython that displays error dialogs. Here is my code:
import wx
class Error:
def __init__(self, number, string):
self.error_type = number
self.error_message = string
self.choose_error()
def choose_error(self):
if self.error_type == 1:
self.DisplayMessage1()
elif self.error_type == 2:
self.DisplayMessage2()
elif self.error_type == 3:
self.DisplayMessage3()
elif self.error_type == 4:
self.DisplayMessage4()
def DisplayMessage1(self):
dial = wx.MessageDialog(None, self.error_message, 'Info', wx.OK)
dial.ShowModal()
def DisplayMessage2(self):
dial = wx.MessageDialog(None, self.error_message, 'Error', wx.OK |
wx.ICON_ERROR)
dial.ShowModal()
def DisplayMessage3(self):
dial = wx.MessageDialog(None, self.error_message, 'Question',
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
dial.ShowModal()
def DisplayMessage4(self):
dial = wx.MessageDialog(None, self.error_message, 'Warning', wx.OK |
wx.ICON_EXCLAMATION)
dial.ShowModal()
How can change the default icons used to the custom ones?? I tried to replace them with wx.Icon but it did not work. Are dialogs in wxPython limited to the icons I used above? On Mac OS X they do not seem to display correctly.