Example #1
0
 def makeToolTipEvent(self, cell):
     event = Event()
     event.type = SWT.MouseHover
     event.widget = self.canvas
     bounds = cell.getBounds()
     event.x = util.getInt(bounds.x) + util.getInt(bounds.width) / 2
     event.y = util.getInt(bounds.y) + util.getInt(bounds.height) / 2
     return event
Example #2
0
 def makeToolTipEvent(self, widgetOrItem):
     event = Event()
     event.type = SWT.MouseHover
     if isinstance(widgetOrItem, Item):
         event.widget = widgetOrItem.getParent()
         event.item = widgetOrItem
         bounds = widgetOrItem.getBounds()
         event.x = util.getInt(bounds.x) + util.getInt(bounds.width) / 2
         event.y = util.getInt(bounds.y) + util.getInt(bounds.height) / 2
     else:
         event.widget = widgetOrItem
         event.item = None
         event.x = -1
         event.y = -1
     return event