LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you specifiy callbacks for child controls on panel created by duplicatepaneltree?

Hi,
I have a situation where I have a complex gui that I'm creating dynamically at start up.  There is a panel that contains a child tab control with 3 tabs.  I use duplicatepaneltree to create panel and the tab control.  I use installPanelCallBack to respond to events from the panel.  How exactly can I specify a callback for the tab control (because I want to respond to tab changes)?
0 Kudos
Message 1 of 2
(2,943 Views)

Normally callbacks are duplicated together with the controls located on the duplicated panel. To duplicate a panel with a tab control on it you don't need to use DuplicatePanelTree: a simple DuplicatePanel is enough and it duplicates the tab control with subpanels and all the associated callbacks.

I am attaching a modified version of TabPanel example that ships with CVI. The modifications are the following:
- Added a callback to the tab control: it correctly shows the active tab page in ACTIVETAB_RING control on the panel
- Added on the main panel a "Dup" button that simply duplicates the panel into a new one
- Modified GenerateWfm callback as an example of how a control on a tab panel can handle the correct panel handle even on the duplicated panel (it used a static handle for the main panel returned from LoadPanel in the main {}: now it obtains the handle of the tab page parent panel, which is necessary to obtain the tab page associated to the tab control)

As you can see, on the duplicated panel tab callback and GenerateWfm callback work consistently addressing the correct panel.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(2,933 Views)