#
hs.chooser
Graphical, interactive tool for choosing/searching data
Notes:
- This module was influenced heavily by Choose, by Steven Degutis (https://github.com/sdegutis/choose)
#
API Overview
Variables - Configurable values
globalCallback
Constructors - API calls which return an object, typically one that offers API methods
new
Methods - API calls which can only be made on an object returned by a constructor
attachedToolbar bgDark cancel choices delete enableDefaultForQuery fgColor hide hideCallback invalidCallback isVisible placeholderText query queryChangedCallback refreshChoicesCallback rightClickCallback rows searchSubText select selectedRow selectedRowContents show showCallback subTextColor width
#
API Documentation
#
Variables
#
globalCallback
Signature | hs.chooser.globalCallback |
Type | Variable |
Description | A global callback function used for various hs.chooser events |
Notes |
|
Source | extensions/chooser/chooser.lua line 29 |
#
Constructors
#
new
Signature | hs.chooser.new(completionFn) -> hs.chooser object |
Type | Constructor |
Description | Creates a new chooser object |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 14 |
#
Methods
#
attachedToolbar
Signature | hs.chooser:attachedToolbar([toolbar]) -> hs.chooser object | currentValue |
Type | Method |
Description | Get or attach/detach a toolbar to/from the chooser. |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/chooser.lua line 13 |
#
bgDark
Signature | hs.chooser:bgDark([beDark]) -> hs.chooser object or boolean |
Type | Method |
Description | Sets the background of the chooser between light and dark |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 539 |
#
cancel
Signature | hs.chooser:cancel() -> hs.chooser object |
Type | Method |
Description | Cancels the chooser |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 805 |
#
choices
Signature | hs.chooser:choices(choices) -> hs.chooser object |
Type | Method |
Description | Sets the choices for a chooser |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 110 |
#
delete
Signature | hs.chooser:delete() |
Type | Method |
Description | Deletes a chooser |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 444 |
#
enableDefaultForQuery
Signature | hs.chooser:enableDefaultForQuery([]) -> hs.chooser object or boolean |
Type | Method |
Description | Gets/Sets whether the chooser should run the callback on a query when it does not match any on the list |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 584 |
#
fgColor
Signature | hs.chooser:fgColor(color) -> hs.chooser object |
Type | Method |
Description | Sets the foreground color of the chooser |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 461 |
#
hide
Signature | hs.chooser:hide() -> hs.chooser object |
Type | Method |
Description | Hides the chooser |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 70 |
#
hideCallback
Signature | hs.chooser:hideCallback([fn]) -> hs.chooser object |
Type | Method |
Description | Sets/clears a callback for when the chooser window is hidden |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 199 |
#
invalidCallback
Signature | hs.chooser:invalidCallback([fn]) -> hs.chooser object |
Type | Method |
Description | Sets/clears a callback for invalid choices |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 415 |
#
isVisible
Signature | hs.chooser:isVisible() -> boolean |
Type | Method |
Description | Checks if the chooser is currently displayed |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 91 |
#
placeholderText
Signature | hs.chooser:placeholderText([placeholderText]) -> hs.chooser object or string |
Type | Method |
Description | Sets/gets placeholder text that is shown in the query text field when no other text is present |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 331 |
#
query
Signature | hs.chooser:query([queryString]) -> hs.chooser object or string |
Type | Method |
Description | Sets/gets the search string |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 290 |
#
queryChangedCallback
Signature | hs.chooser:queryChangedCallback([fn]) -> hs.chooser object |
Type | Method |
Description | Sets/clears a callback for when the search query changes |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 356 |
#
refreshChoicesCallback
Signature | hs.chooser:refreshChoicesCallback([reload]) -> hs.chooser object |
Type | Method |
Description | Refreshes the choices data from a callback |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 256 |
#
rightClickCallback
Signature | hs.chooser:rightClickCallback([fn]) -> hs.chooser object |
Type | Method |
Description | Sets/clears a callback for right clicking on choices |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 386 |
#
rows
Signature | hs.chooser:rows([numRows]) -> hs.chooser object or number |
Type | Method |
Description | Gets/Sets the number of rows that will be shown |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 695 |
#
searchSubText
Signature | hs.chooser:searchSubText([searchSubText]) -> hs.chooser object or boolean |
Type | Method |
Description | Gets/Sets whether the chooser should search in the sub-text of each item |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 621 |
#
select
Signature | hs.chooser:select([row]) -> hs.chooser object |
Type | Method |
Description | Closes the chooser by selecting the specified row, or the currently selected row if not given |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 781 |
#
selectedRow
Signature | hs.chooser:selectedRow([row]) -> number |
Type | Method |
Description | Get or set the currently selected row |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 729 |
#
selectedRowContents
Signature | hs.chooser:selectedRowContents([row]) -> table |
Type | Method |
Description | Returns the contents of the currently selected or specified row |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 758 |
#
show
Signature | hs.chooser:show([topLeftPoint]) -> hs.chooser object |
Type | Method |
Description | Displays the chooser |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 43 |
#
showCallback
Signature | hs.chooser:showCallback([fn]) -> hs.chooser object |
Type | Method |
Description | Sets/clears a callback for when the chooser window is shown |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 228 |
#
subTextColor
Signature | hs.chooser:subTextColor(color) -> hs.chooser object or hs.color object |
Type | Method |
Description | Sets the sub-text color of the chooser |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/chooser/libchooser.m line 500 |
#
width
Signature | hs.chooser:width([percent]) -> hs.chooser object or number |
Type | Method |
Description | Gets/Sets the width of the chooser |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/chooser/libchooser.m line 658 |