comparison browser_side/contact.py @ 195:dd27072d8ae0

browser side: widgets refactoring: - moved base widgets in a base_widget module - widgets class now register themselves their Drag/Drop type
author Goffi <goffi@goffi.org>
date Mon, 04 Mar 2013 23:01:57 +0100
parents d0503f8f15ef
children c2639c9f86ea
comparison
equal deleted inserted replaced
194:6198be95a39c 195:dd27072d8ae0
34 from jid import JID 34 from jid import JID
35 from __pyjamas__ import doc 35 from __pyjamas__ import doc
36 36
37 class DragLabel(DragWidget): 37 class DragLabel(DragWidget):
38 38
39 def __init__(self, text, type): 39 def __init__(self, text, _type):
40 DragWidget.__init__(self) 40 DragWidget.__init__(self)
41 self._text = text 41 self._text = text
42 self._type = type 42 self._type = _type
43 43
44 def onDragStart(self, event): 44 def onDragStart(self, event):
45 dt = event.dataTransfer 45 dt = event.dataTransfer
46 dt.setData('text/plain', "%s\n%s" % (self._text, self._type)) 46 dt.setData('text/plain', "%s\n%s" % (self._text, self._type))
47 dt.setDragImage(self.getElement(), 15, 15) 47 dt.setDragImage(self.getElement(), 15, 15)