def handleEditEvent(self, anEventString ): log.debug("handling event: " + anEventString ) # attributes = NSDictionary.dictionaryWithObject_forKey_(anEvent.nscolor, NSBackgroundColorAttributeName) # attrString = NSAttributedString.alloc().initWithString_attributes_(anEvent.data, attributes) payload = events.unpackevent(anEventString)['text'] # text attrString = NSAttributedString.alloc().initWithString_(payload) insertionPoint = self.mainText.selectedRange()[0] self.mainText.textStorage().insertAttributedString_atIndex_(attrString, insertionPoint)
def remote_event(self, event): print 'Got an event', events.unpackevent( event )