luadocs/content/lua.api.manual/darktable/gui/create_job.md
2021-04-09 00:35:57 -04:00

34 lines
1 KiB
Markdown

---
title: darktable.gui.create_job
id: create_job
weight: 30
draft: false
author: "people"
---
```
function(
text : string,
[percentage : boolean],
[cancel_callback : function]
) : types.dt_lua_backgroundjob_t
```
Create a new progress_bar displayed in [darktable.gui.libs.backgroundjobs](../libs/backgroundjobs.md)
* **text** - _string_ - The text to display in the job entry
* **\[percentage\]** - _boolean_ - Should a progress bar be displayed
* **\[cancel_callback\]** - _[function](#cancel_callback)_ - A function called when the cancel button for that job is pressed. Note: the job won't be destroyed automatically. You need to set [types.dt_lua_backgroundjob_t.valid](../../types/dt_lua_backgroundjob_t#valid) to false for that.
* **return** - _[types.dt_lua_backgroundjob_t](../../types/dt_lua_backgroundjob_t)_ - The newly created job object
## cancel_callback
```
function(
job : types.dt_lua_backgroundjob_t
)
```
* **job** - _[types.dt_lua_backgroundjob_t](../../types/dt_lua_backgroundjob_t)_ - The job that is being cancelled