MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _select

Method _select

gui/utils.py:262–280  ·  view source on GitHub ↗

Handle item selection.

(self, index: int)

Source from the content-addressed store, hash-verified

260 self.selected_index = None
261
262 def _select(self, index: int) -> None:
263 """Handle item selection."""
264 # Deselect previous
265 if self.selected_index is not None and self.selected_index < len(self.items):
266 self.items[self.selected_index].configure(
267 fg_color="transparent",
268 text_color=COLORS["text_primary"],
269 )
270
271 # Select new
272 self.selected_index = index
273 if index < len(self.items):
274 self.items[index].configure(
275 fg_color=COLORS["accent"],
276 text_color=COLORS["text_on_color"], # White text on colored background
277 )
278
279 if self._on_select:
280 self._on_select(index)
281
282 def _double_click(self, index: int) -> None:
283 """Handle double click."""

Callers 3

add_itemMethod · 0.95
_double_clickMethod · 0.95
selectMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected