Hi,
I setup a vbview and now would like to close it and the re-open it. I stumbled here over 2 problems:
-
dialogPtr:close() and thendialogPtr:show() does not work. Shouldn’t it at least reopen the thing? Is there a method for “regenerate” or similar?
-
If I want to rebuild it, it throws an error “‘custom_dialog: content view was already added to some other view or dialog.’”
Obviously I did not yet fully understand the logic behind this.
What I want is to regenerate / rebind the dialogue and then reopen it. I already tried to wrap it into a function and calling it recursively, but wasn’t successful.
The third question is, how to target a control itself within the notifier-function? Let say this code:
vb:textfield {
value = tostring(data[index]),
width = 80,
tooltip = val.txt,
notifier = function(newValue)
if (tonumber(newValue) == nil) then
renoise.app():show_error("Only use numeric values in the field "..index.."!")
else
data[index] = tonumber(newValue)
if (callbackRefresh ~= nil) then
callbackRefresh(data)
end
end
end,
On error, I also want to reset the value of that textfield. How can I address it in the most easy way? Am I forced to use an id then?
In Javascript afaik “this” always targets the most inner scope, so here this would be super easy (I even can do this.parent etc). In lua it seems that “self” only is available for classes / outer objects?