Hi Pritpal, hi Giovanni,
thanks for the advice.
Am Sonntag Juli 15 2012 schrieb Pritpal Bedi:
> Hi
>
> > Function removeButtons( nnr )
> > memvar oLay, oW, oP0, oP1, oP2, oP3, oP4, oP5, oP6
> >
> > do case
> > case nnr == 1
> > oP1:removeWidget()
>
> I assume you want to remove the button permanently.
>
> If YES, then
> oP1:setParent( QWidget() )
I would like to remove the button permanently. But I get segmentation fault.
>
> if NO
> Follow Giovani's reply.
Okay, this does it. But will there be problems with invisible Widgets?
Test code that functions:
PROCEDURE Main()
memvar oLay, oW, oP0, oP1, oP2, oP3, oP4, oP5, oP6
oW := QWidget()
oW:setWindowTitle( "Finestra di Giovanni" )
oW:resize( 400, 100 )
oP0 := QPushButton()
oP0:setText( "OK 1" )
oP0:connect ( " clicked ()", { | | removeButtons( 0 )} )
Function removeButtons( nnr )
memvar oLay, oW, oP0, oP1, oP2, oP3, oP4, oP5, oP6
do case
case nnr == 0
oP0:setVisible(.F.)
case nnr == 1
oP1:setVisible(.F.)
case nnr == 2
oP2:setVisible(.F.)
case nnr == 3
oP3:setVisible(.F.)
case nnr == 4
oP4:setVisible(.F.)
case nnr == 5
oP5:setVisible(.F.)
case nnr == 6
oP6:setVisible(.F.)
endcase
return .t.
Best regards
Claudia