Skip to content

Commit

Permalink
Added documentation for darktable.gui.mimic
Browse files Browse the repository at this point in the history
  • Loading branch information
wpferguson committed Jan 19, 2024
1 parent cd6a88c commit b233ad4
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions content/lua.api.manual/darktable/gui/mimic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: darktable.gui.mimic
id: action
weight: 60
draft: false
author: "people"
---

```
function(
widget_type : string,
name : string,
callback : function
)
```

Provides a virtual widget that can be assigned to a shortcut.

* **widget_type** - _string_ - The type of widget to mimic, one of: button, slider, dropdown.
* **name** - _string_ - The name of the virtual widget that a shortcut can be assigned to.
* **callback** - _function_ - A function containing [darktable.gui.action](../gui/action.md) calls to execute.

## Example

```
local dt = require "darktable"
dt.gui.mimic("slider", "multi-contrast",
function(action, element, effect, size)
if dt.gui.action("iop/filmicrgb", "focus") == 1 then
which = "iop/filmicrgb/contrast"
else
which = "iop/colorbalancergb/contrast"
end
return dt.gui.action(which, element, effect, size)
end
)
```

0 comments on commit b233ad4

Please sign in to comment.