PUBLIC ofrm
ofrm=CREATEOBJECT("MyForm")
ofrm.show()
DEFINE CLASS MyForm as Form
ADD OBJECT opt as optiongroup WITH buttoncount=2,height=90,width=50+2
ADD OBJECT lbl as label WITH caption="Use the spinner",autosize=.T.,top=50
ADD OBJECT spn as spinner WITH top=50,left=100
PROCEDURE init
This.opt.buttons[1].Caption="Some text to simulate a long caption"
This.opt.buttons[2].Caption="Another useless text to simulate a much longer caption"
ThisForm.opt.setall("Width",50)
This.spn.Value=This.opt.buttons[1].Width
ENDPROC
PROCEDURE spn.interactivechange && use the spinner's up and down atrrows to change the width of optionbuttons
ThisForm.opt.setall("Width",This.value)
ThisForm.opt.width=This.value+MAX(ThisForm.opt.buttons[1].left,ThisForm.opt.buttons[2].left)+2
ENDPROC
ENDDEFINE