diff options
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. |