Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
65 lines (52 loc) · 4.61 KB

cp.ui.Button.md

File metadata and controls

65 lines (52 loc) · 4.61 KB

docs » cp.ui.Button


The Button type extends Element and includes all its methods, fields and other properties.

API Overview

  • Functions - API calls offered directly by the extension
  • matches
  • Constructors - API calls which return an object, typically one that offers API methods
  • Button
  • Fields - Variables which can only be accessed from an object returned by a constructor
  • title
  • Methods - API calls which can only be made on an object returned by a constructor
  • doPress
  • press

API Documentation

Functions

Signature cp.ui.Button.matches(element) -> boolean
Type Function
Description Checks if the element is a Button, returning true if so.
Parameters
  • element - The hs._asm.axuielement to check.
Returns
  • true if the element is a Button, or false if not.

Constructors

Signature cp.ui.Button(parent, uiFinder) -> cp.ui.Button
Type Constructor
Description Creates a new Button instance.
Parameters
  • parent - The parent object. Should have a UI and isShowing field.
  • uiFinder - A function which will return the hs._asm.axuielement the button belongs to, or nil if not available.
Returns

The new Button instance.

Fields

Signature cp.ui.Button.title <cp.prop: string; read-only>
Type Field
Description The button title, if available.

Methods

Signature cp.ui.Button:doPress() -> cp.rx.go.Statement
Type Method
Description Returns a Statement that will press the button when executed, if available at the time.
Parameters
  • None
Returns
  • The Statement which will press the button when executed.
Signature cp.ui.Button:press() -> self, boolean
Type Method
Description Performs a button press action, if the button is available.
Parameters
  • None
Returns
  • The Button instance.
  • true if the button was actually pressed successfully.