LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to display small panel always on top

Hi,
From a full-screen panel I open a small panel running in saperate thread and expect an input from the small panel.
Now. if I click somewhere on the big panel, the small one disappers.
Is there a control attribute, to fix the small panel in front until the expected input is made?
I tried by setting floating style to "always", It did not work.
 
Gajanan
0 Kudos
Message 1 of 9
(4,162 Views)
Hi,
 
The problem you are having is because you are creating the small panel in a second thread and the "Always" floating option means it will float above panels *created in the same thread*.
 
The way to do this in the way you want is to post a deferred function call to the thread in which you created your main GUI (see the multithreading library and the programmers toolbox. You pass a parameter that defines what panel you want to a simple function that displays the small panel. The difference is that the panel will be created in your main thread, rather than the secondary thread and everything will work OK.
 
Cheers
 
Jamie
0 Kudos
Message 2 of 9
(4,151 Views)
Hi Jamie,
 
Thanks for your reply, But i do not want to create both panels in same thread.
 
Gajanan
0 Kudos
Message 3 of 9
(4,144 Views)
If you load the small panel as a child panel of the full-screen panel you shouldn't see this happen anymore:
 
//Load the full screen panel
fullScreenPan= LoadPanel (0, "GUI.uir", PANEL);
//Load the small panel as a child of the full screen panel
smallPan = LoadPanel (fullScreenPan, "GUI.uir", PANEL_2);
 
 
0 Kudos
Message 4 of 9
(4,141 Views)

Hi DaveC,

Thanks for your reply, but for that I have to load the panel in same thread, Thats what I do not want to...In my application both panels are in saperate thread.

Gajanan

0 Kudos
Message 5 of 9
(4,126 Views)

Hi,

There should be no reason why you can't display the panel from the main thread. Although the main thread displays the panel, the instruction to do it comes from your secondary thread. Let me know if you think there is a reason this won't work in your application.

Jamie

0 Kudos
Message 6 of 9
(4,122 Views)

Thanks for your suggestion,Now I am planning to do the same thing.

Actully I am using following function to schedulr new thread.

CmtScheduleThreadPoolFunctionAdv (poolHandle, OpenPopup,
                                          NULL,
                                          THREAD_PRIORITY_NORMAL,
                                          NULL,
                                          EVENT_TP_THREAD_FUNCTION_BEGIN,
                                          0, CmtGetCurrentThreadID(), &fnID)

 

In OpenPopup I am loading small panel.
As per your suggestion I will laod the Panel in main thread.
 
Thanks
Gajanan
0 Kudos
Message 7 of 9
(4,113 Views)
Consider using PostDeferredCall()
0 Kudos
Message 8 of 9
(4,108 Views)
Fine
0 Kudos
Message 9 of 9
(4,095 Views)