LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

'Initially hidden' setting on ring control has no effect

Hi,

I'm using LabWindows/CVI v 7.0 running on Win XP. I have a ring control on the main panel set to be 'initially hidden' and 'initially dimmed'. However, when the program launches, the control is not hidden as expected, although it is dimmed. I tried using the SetCtrlAttribute() function to programmatically hide it before calling RunUserInterface(), but this had no effect. However, once the program is running, there is no problem in hiding and unhiding it. Any help appreciated please.

John.
0 Kudos
Message 1 of 4
(3,709 Views)
Hi John,
 I'm not able to reproduce your issue, atleast in isolation.
Can you try the attached project and let me know if that works for you?
If so then I think your issue is in the code itself. As a quick test, open up the uir, and go to tools>>UI to code converter.
Make sure it's generating an a completely separate .c file, and then check the generated code. They should show up as
    errChk(SetCtrlAttribute (hPanel, PANEL_RING, ATTR_VISIBLE, 0));
and
 
    errChk(SetCtrlAttribute (hPanel, PANEL_RING, ATTR_DIMMED, 1));
 
If they're not in there, then the .uir has possibly become corrupted.
Can you post a code snippet that shows it not working back here?
 
Thanks
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 4
(3,692 Views)
Hi Sacha,

Thank you very much for taking the time to assist. Your files worked perfectly and forced me to scrutinise my code in more detail. I have a CVI callback function assigned to multiple panels that are loaded as tabs on startup using the easytab functions. The code in this callback programatically hides or unhides my ring control on the main panel (among other operations), depending on which tab is selected by the user. Testing the 'event' parameter for an EVENT_COMMIT condition never worked with this function, so I chose instead to test the 'panel' variable for the particular panel selected. Inserting a test prompt in this callback revealed that it's called at startup by the 'EasyTab_LoadPanels()' function, for each tab in sequence. Even though not the default selection, the last tab loaded is that which requires the ring control to be unhidden - hence the bug! By capturing the 'event' parameter, I found that it has a value of 6000 when the user clicks on a tab. I'ver read that values between 1000 and 10000 are customised, so I've re-inserted the test for the 'event' parameter checking for values over 999 instead of EVENT_COMMIT. This has solved the problem.

Thanks again,
John.
0 Kudos
Message 3 of 4
(3,673 Views)

Hi John,

  no problem - as long as you're all working again.

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 4
(3,661 Views)