:right-sidebar: True ClampScrollable =================================================================== .. currentmodule:: gi.repository.Adw .. class:: ClampScrollable(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Orientable`, :class:`~gi.repository.Gtk.Scrollable` A scrollable :obj:`~gi.repository.Adw.Clamp`\. ``AdwClampScrollable`` is a variant of :obj:`~gi.repository.Adw.Clamp` that implements the :obj:`~gi.repository.Gtk.Scrollable` interface. The primary use case for ``AdwClampScrollable`` is clamping :obj:`~gi.repository.Gtk.ListView`\. See also: :obj:`~gi.repository.Adw.ClampLayout`\. Constructors ------------ .. rst-class:: interim-class .. class:: ClampScrollable :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwClampScrollable``\. Methods ------- .. rst-class:: interim-class .. class:: ClampScrollable :no-index: .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child widget of ``self``\. .. method:: get_maximum_size() -> int Gets the maximum size allocated to the child. .. method:: get_tightening_threshold() -> int Gets the size above which the child is clamped. .. method:: get_unit() -> ~gi.repository.Adw.LengthUnit Gets the length unit for maximum size and tightening threshold. .. versionadded:: 1.4 .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None Sets the child widget of ``self``\. :param child: the child widget .. method:: set_maximum_size(maximum_size: int) -> None Sets the maximum size allocated to the child. It is the width if the clamp is horizontal, or the height if it is vertical. :param maximum_size: the maximum size .. method:: set_tightening_threshold(tightening_threshold: int) -> None Sets the size above which the child is clamped. Starting from this size, the clamp will tighten its grip on the child, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum width, the child will be allocated all the available size. If the threshold is greater than the maximum size to allocate to the child, the child will be allocated all the width up to the maximum. If the threshold is lower than the minimum size to allocate to the child, that size will be used as the tightening threshold. Effectively, tightening the grip on the child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing. :param tightening_threshold: the tightening threshold .. method:: set_unit(unit: ~gi.repository.Adw.LengthUnit) -> None Sets the length unit for maximum size and tightening threshold. Allows the sizes to vary depending on the text scale factor. .. versionadded:: 1.4 :param unit: the length unit Properties ---------- .. rst-class:: interim-class .. class:: ClampScrollable :no-index: .. attribute:: props.child :type: ~gi.repository.Gtk.Widget The type of the None singleton. .. attribute:: props.maximum_size :type: int The type of the None singleton. .. attribute:: props.tightening_threshold :type: int The type of the None singleton. .. attribute:: props.unit :type: ~gi.repository.Adw.LengthUnit The type of the None singleton. .. versionadded:: 1.4