Accessing A Viewbuilder Dialog'S Widgets From Outside

Suppose i have a dialog that i built with the code below (just an example, actually a copy and paste from sample auto slicer):

local row6 = vb:row {
vb:button {
text = “Slice!”,
tooltip = “Split the selected sample into slices”,
height = DEFAULT_DIALOG_BUTTON_HEIGHT,
width = vb.views[“nSlices”].width,
notifier = function()
slice_it(false)
stop_slice_show()
end
},
vb:button {
text = “Cancel”,
tooltip = “Close dialog and abort operation”,
height = DEFAULT_DIALOG_BUTTON_HEIGHT,
width = vb.views[“nSlices”].width,
notifier = function()
stop_slice_show()
dialog:close()
end
}
}

dialog = renoise.app():show_custom_dialog (
“Auto Slicer”,
vb:column{
margin = DEFAULT_DIALOG_MARGIN,
spacing = DEFAULT_CONTROL_SPACING,
row6,
vb:space { }
}
)

---- (end code)

if oprint(dialog) i get this:

oprint(dialog)
class: Dialog
properties:
visible
methods:
__STRICT
close
show

that is… no obvious way of changing the text on the button (or any other control; i am actually trying to build an additional debug console)

Any idea how i could do this? TIA

rprint(vb.views) looks more interesting though =)

  
vb:button {  
 text = "Slice!",  
 id = "button_1_id",  
 tooltip = "Split the selected sample into slices",  
 height = DEFAULT_DIALOG_BUTTON_HEIGHT,  
 width = vb.views["nSlices"].width,  
 notifier = function()  
 slice_it(false)  
 stop_slice_show()  
 end  
 },  
  
  

To change the text for this button you add a field: id which you name as a string.

id = “button_1_id”

You can then access via

vb.views[
“button_1_id”].text = “My New Text”

thank you!

ill be posting another question in a second…