LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

reparent a panel

I would like to "reparent" a panel. I have a child panel which I would like to move over to another panel. I have not been able to find a direct way to do this (SetPanelAttribute does not allow the parent panel to be set only inspected), but would the following code work?
HidePanel (child);
temp = DuplicatePanel (new_parent, child, NULL, 0, 0);
DiscardPanel (child);
child = temp;
ShowPanel (child);
Will all the controls in this new panel be in the same state they were in when I did the duplication? Will attributes that I have set (such as ATTR_CALLBACK_DATA) be carried over to the new panel? If a simple solution like this is possible I would like to use it. However, if things are more complex than this I will restrict my class to re
quire that the correct parent be given in it's constructor.
thank you
jackson
0 Kudos
Message 1 of 2
(2,697 Views)
I would just do a SavePanelState to save the current state of the panel (values, attributes, etc) to file. Then Discard the child panel and reload it on the new parent and call RecallPanelState to return the the state of the child panel from the file.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,697 Views)