Is there a better order of instructions than this? The dialog does not always become visible before .execute()
I have to resize near the end anyway – maybe I should just start at .width & .height = 0 or 1?
tia,
-dave
sub tst
dlgmdl = createunoservice("com.sun.star.awt.UnoControlDialogModel")
with dlgmdl
.name = "checkwriter"
.title = "Check Writer"
.positionx = 170
.positiony = 70
.width = 300
.height = 100
end with
dlg = CreateUnoService("com.sun.star.awt.UnoControlDialog")
dlg.setModel(dlgmdl)
window = CreateUnoService("com.sun.star.awt.Toolkit")
dlg.createPeer(window, null)
dlg.setvisible(false)
ctlmdl = dlgmdl.createinstance("com.sun.star.awt.UnoControlFixedTextModel")
with ctlmdl
.name = "HI"
.label = "HI"
.positionx = 10
.positiony = 10
.width = 20
.height = 20
end with
dlgmdl.insertbyname("HI", ctlmdl)
' insert about 30 more controls...
' resize dialog as appropriate (varies)...
dlg.setvisible(true)
dlg.execute()
end sub