예제 #1
0
    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)
예제 #2
0
 def remote_event(self, event):
     print 'Got an event', events.unpackevent( event )