def on_query_tooltip(self, widget, x, y, kbd_ctx, tooltip): """Handle a tooltip creation request.""" tip_context = self.ttreeview.get_tooltip_context(x, y, kbd_ctx) if tip_context is None: self._prev_tooltip_task_id = None return False x, y = self.ttreeview.convert_widget_to_bin_window_coords(x, y) path, column, cell_x, cell_y = self.ttreeview.get_path_at_pos(x, y) if not path: return False model = self.ttreeview.get_model() point_string = model.get_value(model.get_iter(path), 0) name = model.get_value(model.get_iter(path), 1) if point_string == name: # We are hovering over a cycle point row. task_id = point_string else: # We are hovering over a task or family row. task_id = TaskID.get(name, point_string) if task_id != self._prev_tooltip_task_id: # Clear tooltip when crossing row boundaries. self._prev_tooltip_task_id = task_id tooltip.set_text(None) return False text = get_id_summary( task_id, self.state_summary, self.fam_state_summary, self.descendants ) if text == task_id: return False tooltip.set_text(text) return True
def on_query_tooltip(self, widget, x, y, kbd_ctx, tooltip): """Handle a tooltip creation request.""" tip_context = self.ttreeview.get_tooltip_context(x, y, kbd_ctx) if tip_context is None: self._prev_tooltip_task_id = None return False x, y = self.ttreeview.convert_widget_to_bin_window_coords(x, y) path, column, cell_x, cell_y = self.ttreeview.get_path_at_pos(x, y) if not path: return False model = self.ttreeview.get_model() point_string = model.get_value(model.get_iter(path), 0) name = model.get_value(model.get_iter(path), 1) if point_string == name: # We are hovering over a cycle point row. task_id = point_string else: # We are hovering over a task or family row. task_id = TaskID.get(name, point_string) if task_id != self._prev_tooltip_task_id: # Clear tooltip when crossing row boundaries. self._prev_tooltip_task_id = task_id tooltip.set_text(None) return False text = get_id_summary(task_id, self.state_summary, self.fam_state_summary, self.descendants) if text == task_id: return False tooltip.set_text(text) return True
def on_query_tooltip(self, widget, x, y, kbd_ctx, tooltip): """Handle a tooltip creation request.""" tip_context = self.led_treeview.get_tooltip_context(x, y, kbd_ctx) if tip_context is None: self._prev_tooltip_task_id = None return False x, y = self.led_treeview.convert_widget_to_bin_window_coords(x, y) path, column, cell_x, cell_y = self.led_treeview.get_path_at_pos(x, y) col_index = self.led_treeview.get_columns().index(column) if not self.is_transposed: iter_ = self.led_treeview.get_model().get_iter(path) name = self.led_treeview.get_model().get_value(iter_, 0) try: point_string = self.led_headings[col_index] except IndexError: # This can occur for a tooltip while switching from transposed. return False if col_index == 0: task_id = name else: task_id = TaskID.get(name, point_string) else: try: point_string = self.point_strings[path[0]] except IndexError: return False if col_index == 0: task_id = point_string else: try: name = self.led_headings[col_index] except IndexError: return False task_id = TaskID.get(name, point_string) if task_id != self._prev_tooltip_task_id: self._prev_tooltip_task_id = task_id tooltip.set_text(None) return False if col_index == 0: tooltip.set_text(task_id) return True text = get_id_summary(task_id, self.state_summary, self.fam_state_summary, self.descendants) if text == task_id: return False tooltip.set_text(text) return True
def get_summary(self, task_id): return get_id_summary(task_id, self.state_summary, self.fam_state_summary, self.descendants)