def __init__(self, parentFrame, ID, user, message, colorSet = _DEFAULT_COLORSET, size = wx.DefaultSize, pos = wx.DefaultPosition, style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX): wx.Frame.__init__(self, None, ID, user.name, size = size, style = style, name = 'message_dialog_' + user.name) assert isinstance(user, Buddy) self._user = user self._parentFrame = parentFrame self._history = History.restore(self._user) print len(colorSet), len(_DEFAULT_COLORSET) assert len(colorSet) == 4 self._colorSet = colorSet self.topPanel = MessagePanel(self, 'junk') PersistenceMixin.__init__(self, self.topPanel, 'widgets.save') # --- self.setUserName(self._user) self.setTitle(self._user) try: self.restoreObjects([self.GetId(), ID_BUTTON_SEND, ID_SPLITTER], name = self._user.name) except: typ, value, tb = sys.exc_info() list = traceback.format_tb(tb, None) + \ traceback.format_exception_only(type, value) err = "%s %s" % ( "".join(list[:-1]), list[-1], ) print 'restoreObjects: ' print err # Shortcuts self._incoming = self.topPanel._incoming self._outgoing = self.topPanel._outgoing # --- self.Bind(wx.EVT_BUTTON, self.onSendMessage, id = ID_BUTTON_SEND) self.Bind(wx.EVT_BUTTON, self.onCancel, id = wx.ID_CANCEL) self.Bind(wx.EVT_CLOSE, self.onClose) self.populateHistory() if message is not None: self.updateMessage(message)