thank you very much for the quick reply. I have tried intensively your suggestions.
But still I am not able to store presets for the widget using the “sandwich” icon on the top right corner of my module.
darktable.preferences.register and darktable.preferences.write are working both fine for my code. If I register the preference I can easily manipulate it from the built-in perferences dialog under the section “lua options”. But I cannot store it as preset.
For the second button in the top right corner I successfully use the “reset_callback” of the widget that I add using darktable.register_lib. But there is no “store-presets_callback”.
The good news is that there is some support in the Lua API for presets contained in src/lua/modules.c.
The bad news is that it was written 10 years ago and doesn’t appear to do much. I came across it several weeks ago and haven’t had time to play with it.
I am not very good in c, but I tried to understand it nevertheless. Unfortunately I was not able to derive how call those functions from a lua script and which parameters to hand over.
local darktable = require “darktable”
=> darktable.modules is nil.