Changeset 879:657c4c4dc357
- Timestamp:
- 09/03/17 15:00:35 (7 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/timetable.py
r859 r879 223 223 """Update the tooltip for the position of the given event.""" 224 224 try: 225 (path, col, x, y) = widget.get_path_at_pos( int(event.x), int(event.y)) 226 index = self._getIndexForPath(path) 227 228 flight = self._flightPairs[index].flight0 229 comment = flight.comment 230 date = flight.date 231 232 if comment or date!=const.defaultDate: 233 text = "" 234 if comment: 235 text = comment 236 if date!=const.defaultDate: 237 if text: 238 text += "; " 239 text += date.strftime("%Y-%m-%d") 240 241 self._tooltips.set_tip(widget, text) 242 self._tooltips.enable() 243 else: 225 result = widget.get_path_at_pos( int(event.x), int(event.y)) 226 if result is None: 244 227 self._tooltips.set_tip(widget, "") 245 228 self._tooltips.disable() 229 else: 230 (path, col, x, y) = result 231 index = self._getIndexForPath(path) 232 233 flight = self._flightPairs[index].flight0 234 comment = flight.comment 235 date = flight.date 236 237 if comment or date!=const.defaultDate: 238 text = "" 239 if comment: 240 text = comment 241 if date!=const.defaultDate: 242 if text: 243 text += "; " 244 text += date.strftime("%Y-%m-%d") 245 246 self._tooltips.set_tip(widget, text) 247 self._tooltips.enable() 248 else: 249 self._tooltips.set_tip(widget, "") 250 self._tooltips.disable() 246 251 except Exception, e: 247 252 print e
Note:
See TracChangeset
for help on using the changeset viewer.