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

Method _bind_scroll_to_widget

gui/widgets.py:521–531  ·  view source on GitHub ↗

Bind scroll events to a specific widget and its children.

(self, widget)

Source from the content-addressed store, hash-verified

519 self._bind_scroll_to_widget(frame.get_content_frame())
520
521 def _bind_scroll_to_widget(self, widget) -> None:
522 """Bind scroll events to a specific widget and its children."""
523 if platform.system() == "Linux":
524 widget.bind("<Button-4>", self._on_scroll_up, add="+")
525 widget.bind("<Button-5>", self._on_scroll_down, add="+")
526 else:
527 widget.bind("<MouseWheel>", self._on_mousewheel, add="+")
528
529 # Recursively bind to children
530 for child in widget.winfo_children():
531 self._bind_scroll_to_widget(child)
532
533 def _on_mousewheel(self, event) -> Optional[str]:
534 """Handle mouse wheel on Windows/macOS."""

Callers 1

_bind_scroll_eventsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected