From 2b577f975556f4152b05c4f7553121dea25c1939 Mon Sep 17 00:00:00 2001 From: supertobi Date: Thu, 7 Apr 2016 23:29:08 +0200 Subject: [PATCH] improved the entry and file_chooser_button examples --- examples/moduleExample.lua | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/examples/moduleExample.lua b/examples/moduleExample.lua index f484dff..91a34f0 100644 --- a/examples/moduleExample.lua +++ b/examples/moduleExample.lua @@ -37,8 +37,25 @@ dt.configuration.check_version(...,{3,0,0}) -- add a new lib local check_button = dt.new_widget("check_button"){label = "MyCheck_button", value = true} local combobox = dt.new_widget("combobox"){label = "MyCombobox", value = 2, "8", "16", "32"} -local entry = dt.new_widget("entry"){text = "test", placeholder = "placeholder", tooltip = "tooltip"} -local file_chooser_button = dt.new_widget("file_chooser_button"){title = "MyFile_chooser_button"} + +--https://www.darktable.org/lua-api/ar01s02s54.html.php +local entry = dt.new_widget("entry") +{ + text = "test", + placeholder = "placeholder", + is_password = false, + editable = true, + tooltip = "Tooltip Text", + reset_callback = function(self) self.text = "text" end +} + +local file_chooser_button = dt.new_widget("file_chooser_button") +{ + title = "MyFile_chooser_button", -- The title of the window when choosing a file + value = "", -- The currently selected file + is_directory = false -- True if the file chooser button only allows directories to be selecte +} + local label = dt.new_widget("label") label.label = "MyLabel" -- This is an alternative way to the "{}" syntax to set a property