02-21-2013 12:31 AM
I'm trying to create the interface of my program using a tab switcher, and then using buttons to navigate programmatically. However... the buttons do not seem to switch the tabs. Occasionally one will work, but 99% of the time it fails. I have attached a simplified version to demonstrate this problem.
I suspect this is a bug -- running the program with highlight exection works perfectly.
Thanks for your help.
Solved! Go to Solution.
02-21-2013 02:54 AM - edited 02-21-2013 02:55 AM
I am not sure if this really expected behavior what you are seeing.
But you have to certainly clean up your code.
I made some tests and the recommended way to solve is the following:
1.) Put the terminals of the buttons in "their" event case
2.) Change the event from "mouse up" to "value change". It should work then.
Norbert
EDIT: The more i think about this i can explain the behavior by the following guess: mouse up does not initiate a re-draw event for the UI, so the tab control simple doesn't get redrawn with the new active tab.
02-21-2013 03:03 AM
I see the same thing with highlight vs non. However, I have not seen many uses of buttons and event structures that are not latch-when-released, and value-change:
02-21-2013 03:40 AM
I have seen similar things in the past, where a tab control does not switch when using a local variable. Using a value property node instead solved the issue, probably for the reason Norbert suggested - it forces a redraw.
That said, I agree with the others that I wouldn't do it like this.
02-24-2013 04:29 PM
Thanks -- using a property value works. You said you wouldn't do it like this -- is there an alternative you would do? I'm trying to make the interface for this program event driven, and this seemed like the simplest way.
02-25-2013 02:00 AM
There's nothing necessarily wrong with using a tab control and controlling which page is displayed programmatically. I was refering more to the style (value change, terminals inside event cases, not having race conditions, etc.).
There are also other alternatives like having each step in a separate VI and displaying it in a subpanel, but that can be more complicated.