Reparenting a dynamic widget?

lmanzanero

New Member
Hi there:

OS: W98
V 8.3A

Ok, I've been for hours working on this: According to the programming handbook, it is possible to set the parent (or frame) for a dynamic widget, but when I try to set the PARENT attribute of any widget (lets say a simple text or combo-box) I get the error message "**OWNER/PARENT exists on the <widget id>. Unable to set attribute <attribute>. (4074)
Reparenting is not allowed. Once a parent has been defined for a widget, it can't be changed."

Now, if I try to change the FRAME property (the ·$%$& manual says it is possible) I get another error "**Unable to set <attribute> on <widget id>. It already has iteration. (4098)
This widget already belongs to a field group and can't be reparented. Check the definition of the widget to make sure you did not set the PARENT attribute and then the FRAME attribute. "

the code compiles normally, and here´s the example:

/** First of all, create a new project at the UIB with 2 empty frames fr1 & fr2, declare the widget-handle xp at the beggining of the code, then add this procedure and call it at the start of the execution process */

procedure test:
def var a as widget-handle.
def var b like a.

create Text xp
assign auto-resize = true
screen-value = "Saludos" /* whatever */
row = 3
column = 4
Visible = true
Height-chars = 2
width-chars = 10
Frame = Frame fr1:Handle
.
enable all with frame fr1.
message "frame name" xp:Frame-name view-as alert-box. /* So Far, so good */

enable all with frame fr2.

/* xp:Frame = frame fr2:handle. ---> Uncomment this to get error 4098 */

/* This loop goes according to the programming handbook to find the foreground field group of the frame */
a = frame fr2:first-child .
do while valid-handle(a) :
if a:foreground then do:
b = a:first-child .
/* xp:frame = b:frame . Uncomment this to get error 4098 */
xp:parent = b:parent. /* Here you get error 4074 */
message "frame name" xp:Frame-name view-as alert-box. /* Nothing happened */
leave.
end.
else
a = frame fr2:next-sibling .
end.


END PROCEDURE.

/** End Test */

Now, What am I doing wrong?, or maybe it's a "simple" typo in the manual or what?, any help would be greatly appreciated

Thanks
Luis Manzanero
 
Top