MCPcopy
hub / github.com/Textualize/textual / find_widget

Method find_widget

src/textual/screen.py:740–752  ·  view source on GitHub ↗

Get the screen region of a Widget. Args: widget: A Widget within the composition. Returns: Region relative to screen. Raises: NoWidget: If the widget could not be found in this screen.

(self, widget: Widget)

Source from the content-addressed store, hash-verified

738 return self._compositor.get_widget_and_offset_at(x, y)
739
740 def find_widget(self, widget: Widget) -> MapGeometry:
741 """Get the screen region of a Widget.
742
743 Args:
744 widget: A Widget within the composition.
745
746 Returns:
747 Region relative to screen.
748
749 Raises:
750 NoWidget: If the widget could not be found in this screen.
751 """
752 return self._compositor.find_widget(widget)
753
754 def clear_selection(self) -> None:
755 """Clear any selected text."""

Callers 7

_handle_mouse_moveMethod · 0.95
_forward_eventMethod · 0.95
_selection_orderMethod · 0.45
regionMethod · 0.45
dock_gutterMethod · 0.45
virtual_regionMethod · 0.45
is_on_screenMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected