diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-03-18 22:43:27 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-03-18 22:43:27 -0400 |
commit | 612c43f3b1c0351fe2601ed73024d39bacd4ed52 (patch) | |
tree | e8b422252d6ee8e9ed9790ab0b7732049f992c7b /core/.ui.dialogs.luadoc | |
parent | 9b02a146612e1a2e15b7bb8d2a5185f1d3925572 (diff) |
Added `ui.dialogs.progressbar()` and utilize it with Find in Files.
Diffstat (limited to 'core/.ui.dialogs.luadoc')
-rw-r--r-- | core/.ui.dialogs.luadoc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/.ui.dialogs.luadoc b/core/.ui.dialogs.luadoc index 0a6579d1..08a810d1 100644 --- a/core/.ui.dialogs.luadoc +++ b/core/.ui.dialogs.luadoc @@ -325,6 +325,32 @@ function filesave(options) end function textbox(options) end --- +-- Displays a progressbar dialog defined by dialog options table *options* and +-- updates from function *f*. +-- Returns "stopped" if *options*.`stoppable` is `true` and the user clicked the +-- "Stop" button. Otherwise, returns `nil`. +-- @param options Table of key-value option pairs for the progressbar dialog. +-- +-- * `title`: The dialog's title text. +-- * `percent`: The initial progressbar percentage between 0 and 100. +-- * `text`: The initial progressbar display text (GTK only). +-- * `indeterminate`: Show the progress bar as "busy", with no percentage +-- updates. +-- * `stoppable`: Show the "Stop" button. +-- * `width`: The dialog's pixel width. +-- * `height`: The dialog's pixel height. +-- @param f Function repeatedly called to do work and provide progress updates. +-- The function is called without arguments and must return either `nil`, +-- which indicates work is complete, or a progress percentage number in the +-- range 0-100 and optional string text to display (GTK only). If the text +-- is either "stop disable" or "stop enable" and *options*.`stoppable` is +-- `true`, the "Stop" button is disabled or enabled, respectively. +-- @return nil or "stopped" +-- @usage ui.dialogs.progressbar({stoppable = true}, +-- function() if work() then return percent, status else return nil end end) +function progressbar(options, f) end + +--- -- Prompts the user with a drop-down item selection dialog defined by dialog -- options table *options*, returning the selected button's index along with the -- index of the selected item. |