09-18-2008 12:20 AM
09-18-2008 01:06 AM
You can't. You can only show previously-created (Edit-Time) controls.
LV does not support control creation on-the-fly.
Shane.
09-18-2008 01:18 AM - edited 09-18-2008 01:20 AM
Intaris a écrit: You can't. You can only show previously-created (Edit-Time) controls.LV does not support control creation on-the-fly.
The answer is a bit more complicated. See a discussion of the same question here 😉
09-18-2008 01:22 AM
Yes, but that's not strictly creating controls, is it? It's mimicing controls.
It's certainly a nice feature to have when you come up against a fundamental limitation of LV, but I think someone who is not yet aware of the fact that LV in itself does not support dynamic control creation should try first to write code in a way that is compatible with this....
Shane.
09-18-2008 01:43 AM - edited 09-18-2008 01:47 AM
Intaris a écrit: Yes, but that's not strictly creating controls, is it? It's mimicing controls.It's certainly a nice feature to have when you come up against a fundamental limitation of LV, but I think someone who is not yet aware of the fact that LV in itself does not support dynamic control creation should try first to write code in a way that is compatible with this....
My point of view is different. When somebody ask a question, for which there is indeed a solution, I'll try to avoid saying "No, there is no solution". I'll balance my reply to take into account "environment" parameters (difficulty, cost, time, compactness...). As a university professor, this is a situation I have to face with my students on a daily basis. And, from experience, I found it is most often more rewarding for everybody to say "Yes you can...but...". It leaves the parter the possibility to decide himself if the solution fits his needs.
In the specific case of LabVIEW limitations, I also think that it is better to acknowledge the limitation and propose a workaround (= a way to write code that is compatible with the problem) that is most often more efficient than the way the "customer" was considering. 😄
There are no problem, just solutions
09-18-2008 01:47 AM - edited 09-18-2008 01:50 AM
OK, I don't want to start a philosophical discussion here.
The original question was how to generate controls on-the-fly. This is not possible, but a simulation of this is possible via the link you provided.
It's now up to the original poster to decide which way is easier for him, adapt his UI to work with pre-determined controls (maybe be hiding and showing to give the illusion of creation) or using a toolkit to mimic the creation of controls. Both ways are valid, but as to which way is best, that's an individual opinion.
Shane.
09-18-2008 06:00 AM - edited 09-18-2008 06:01 AM
"Been there, doing that"
Speaking as a developer that has been developing in LV for about ten years and have helped pioneer the "Create the Control on the Fly" (CCOF) concepts AND being nine months into the the ultimate CCOF project (app has only two Picture Control on FP!* ) I can say,
"The simplest solution is the best solution."
If there is an easier wasy (like hiding/showing controls) then use that approach.
BTW: My NI Week paper on this topic was rejected. Go figure. ![]()
Ben
* It does give one a very good appreciation of what NI has given us with LV though. ![]()