TTkAbstractScrollViewInterface🌶️

class TTkAbstractScrollViewInterface[source]🌶️

Bases: object

The TTkAbstractScrollViewInterface provide the basic interface that can be used in TTkAbstractScrollArea to enable on-demand scroll bars.

When subclassing TTkAbstractScrollViewInterface, you must implement viewFullAreaSize(), viewDisplayedSize(), getViewOffsets(), and viewMoveTo().

This interface is implemented in the following specialised classes:

Slots🌶️

viewMoveTo(x, y)

This method is used to set the vertical and horizontal offsets of the TTkAbstractScrollViewInterface

Methods🌶️

getViewOffsets() tuple[source]🌶️

Retrieve the vertical and horizontal offsets of the TTkAbstractScrollViewInterface

Note

Reimplement this function to handle this event

This method is already implemented in the following classes:
Returns:

the (x,y) offset

Return type:

tuple[int,int]

viewDisplayedSize() tuple[int, int][source]🌶️

This method returns the displayed size of the TTkAbstractScrollViewInterface implementation.

Note

Reimplement this function to handle this event

This method is already implemented in the following classes:

Unless a different iplementation is required, by default it should return TTkWidget.size()

Returns:

the displayed size as a tuple of 2 int elements (width,height)

Return type:

tuple[int,int]

viewFullAreaSize() tuple[int, int][source]🌶️

This method returns the full widget area size of the TTkAbstractScrollViewInterface implementation.

This is required to TTkAbstractScrollArea implementation to handle the on-demand scroll bars.

Note

Reimplement this function to handle this event

Returns:

the full area size as a tuple of 2 int elements (width,height)

Return type:

tuple[int,int]

viewMoveTo(x: int, y: int)[source]🌶️

This method is used to set the vertical and horizontal offsets of the TTkAbstractScrollViewInterface

Note

Reimplement this function to handle this event

This method is already implemented in the following classes:
Parameters:
  • x (int) – the horizontal position

  • y (int) – the vertical position