Internationalisation
Bundled Plugins API
ScrollArea
Scroll Area Module.

API Overview

API Documentation

Functions

matches

Signature
cp.ui.ScrollArea.matches(element) -> boolean
Type
Function
Description
Checks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches otherwise false

Constructors

Signature
cp.ui.ScrollArea(parent, uiFinder) -> cp.ui.ScrollArea
Type
Constructor
Description
Creates a new ScrollArea.
Parameters
  • parent - The parent object.
  • uiFinder - A function or cp.prop which will return the hs._asm.axuielement when available.
Returns
  • The new ScrollArea.

Fields

Signature
cp.ui.ScrollArea.contentsUI <cp.prop: hs._asm.axuielement; read-only; live?>
Type
Field
Description
Returns the axuielement representing the Scroll Area Contents, or nil if not available.
Signature
cp.ui.ScrollArea.horizontalScrollBar <cp.ui.ScrollBar>
Type
Field
Description
The horizontal ScrollBar.
Signature
cp.ui.ScrollArea.selectedChildrenUI <cp.prop: hs._asm.axuielement; read-only; live?>
Type
Field
Description
Returns the axuielement representing the Scroll Area Selected Children, or nil if not available.
Signature
cp.ui.ScrollArea.verticalScrollBar <cp.ui.ScrollBar>
Type
Field
Description
The vertical ScrollBar.

viewFrame

Signature
cp.ui.ScrollArea.viewFrame <cp.prop:hs.geometry.rect; read-only>
Type
Field
Description
A cp.prop reporting the Scroll Area frame as a hs.geometry.rect.

Methods

| Signature | cp.ui.ScrollArea:childrenUI(filterFn) -> hs._asm.axuielement | nil | | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Returns the axuielement representing the Scroll Area Contents, or nil if not available. | | Parameters |
  • filterFn - The function which checks if the child matches the requirements.
|
Signature
cp.ui.ScrollArea:deselectAll() -> self
Type
Method
Description
Deselect all children in a scroll area.
Parameters
  • None
Signature
cp.ui.ScrollArea:loadLayout(layout) -> none
Type
Method
Description
Loads a Scroll Area layout.
Parameters
  • layout - A table containing the ScrollArea layout settings, typically created using saveLayout.
Returns
  • None
Signature
cp.ui.ScrollArea:saveLayout() -> table
Type
Method
Description
Saves the current Scroll Area layout to a table.
Parameters
  • None
Returns
  • A table containing the current Scroll Area Layout.

selectAll

Signature
cp.ui.ScrollArea:selectAll(childrenUI) -> self
Type
Method
Description
Select all children in a scroll area.
Parameters
  • childrenUI - A table of hs._asm.axuielement objects.
Signature
cp.ui.ScrollArea:selectChild(childUI) -> self
Type
Method
Description
Select a specific child within a Scroll Area.
Parameters
  • childUI - The hs._asm.axuielement object of the child you want to select.
Signature
cp.ui.ScrollArea:selectChildAt(index) -> self
Type
Method
Description
Select a child element in a Scroll Area given a specific index.
Parameters
  • index - The index of the child you want to select.
Signature
cp.ui.ScrollArea:shiftHorizontalBy(amount) -> number
Type
Method
Description
Attempts to shift the horizontal scroll bar by the specified amount.
Parameters
  • amount - The amount to shift
Returns
  • The actual value of the horizontal scroll bar.
Signature
cp.ui.ScrollArea:shiftHorizontalTo(value) -> number
Type
Method
Description
Attempts to shift the horizontal scroll bar to the specified value.
Parameters
  • value - The new value (typically between 0 and 1).
Returns
  • The actual value of the horizontal scroll bar.
Signature
cp.ui.ScrollArea:shiftVerticalBy(amount) -> number
Type
Method
Description
Attempts to shift the vertical scroll bar by the specified amount.
Parameters
  • amount - The amount to shift
Returns
  • The actual value of the vertical scroll bar.
Signature
cp.ui.ScrollArea:shiftVerticalTo(value) -> number
Type
Method
Description
Attempts to shift the vertical scroll bar to the specified value.
Parameters
  • value - The new value (typically between 0 and 1).
Returns
  • The actual value of the vertical scroll bar.

showChild

Signature
cp.ui.ScrollArea:showChild(childUI) -> self
Type
Method
Description
Show's a child element in a Scroll Area.
Parameters
  • childUI - The hs._asm.axuielement object of the child you want to show.
Signature
cp.ui.ScrollArea:showChildAt(index) -> self
Type
Method
Description
Show's a child element in a Scroll Area given a specific index.
Parameters
  • index - The index of the child you want to show.
Last modified 1mo ago