Please, help!!!
I need to divide the building code for " ViewBuilder" in two or more files, using " require" (or “module”?).
Currently I have this error, that appears after close and reopen the tool (floating window),for the second time:
The error:
'C:\Users\PC\AppData\Roaming\Renoise\V3.1.0\Scripts\Tools\XXX.YYY.v3.xrnx\' failed to execute in one of its menu entry functions.
Please contact the author (ulneiz) for assistance...
std::logic_error: 'ViewBuilder: trying to add a view which already was added, probably into a different parent view.'
stack traceback:
[C]: in function '?'
main.lua:3196: in function <main.lua:1688>
…this error appears with the Terminal closed.
In main.lua I have:
main.lua:
bla bla bla
...
require ("tools/tool_01")
...
bla bla bla
...
function show_dialog()
vb = renoise.ViewBuilder()
...
bla bla bla
...
-- CONTENT FLOATING WINDOW --
local content = vb:column {
width = 660,
margin = 5,
--menu-------------------------------------
vb:horizontal_aligner { height = 5 },
vb:column {
style = 'group', --body
margin = 10,
vb:horizontal_aligner {
mode = 'right',
vb:column {
vb:horizontal_aligner {
margin = 5,
vb:text {
font = 'bold', --> normal, big, bold, italic, mono
text = '1.- Select a Principal Option :'
},
},
},
...
bla bla bla
...
},-------------------------------01
vb:column {
visible = false,
id = 'tlstab_03',
style = 'body',
width = 702,
height = '100%',
margin = 10,
groups_control, --Add "tool_01" <---------LOOK HERE!----
},
...
bla bla bla
...
This " groups_control" is another large piece of various " vb:"charged through of “require (“tools/tool_01”)”.
I have another " tool_01.lua" inside the folder “tools” with the following code:
tool_01.lua:
...
bla bla bla
...
--------------------------------------------------------------------------------
-- GUI TOOL 01
--------------------------------------------------------------------------------
vb = renoise.ViewBuilder()
groups_control = <---------LOOK HERE!----
vb:column {
vb:horizontal_aligner {
mode = 'center',
vb:text { font = 'bold', text = 'GRC: Groups Control' },
vb:text { font = 'normal', text = ' v1.0 ...Tool 03' },
},
vb:horizontal_aligner { height = 10 },
----
vb:horizontal_aligner {
mode = 'justify',
vb:column { -- 01 right column
vb:vertical_aligner {
vb:horizontal_aligner {
width = 108,
vb:button {
...
bla bla bla
...
When I close the floating window of the tool for the first time, it seems stored information in memory, and then reload does not allow the same floating window. It seems as if charged 2 times the same.
I also use this code to prevent open multiple floating windows of the same tool, but does not solve this error:
Code of “Prevent multiple floating windows”:
if dialog and dialog.visible then dialog:show() return end
Is it possible to avoid this error?I need to have the code of ViewBuilder in various files , because it is very long…
Danoise, Dblue…Any idea what’s going on here and how fix it???
Thanks!!!