06-10-2021 09:17 AM
@gepponline wrote:
Hi,
is it possible to create and resize a button in a running vi's front panel?
I would like for example to place a square button where I press mouse down and then, if I drag left and right borders, resize it.
I've done something similar in the past using images, but this time I need buttons to be single objects I can move in a second time
Kind of. You can't Create buttons, but you can have a hidden one you show, and resize and move is easy.
06-10-2021 09:20 AM
06-10-2021 09:32 AM
"If your only tool is a Hammer, every Problem becomes a Nail".
If you need to create 500, or 1000 "hidden buttons", use LabVIEW Scripting and create them. If you want, you can probably figure out how to place each one at a pre-determined coordinate on your Front Panel, create a function that takes a pair of Coordinates and returns the reference to the Button nearest to that Coordinate, and you can turn the Button "Visible" or "Invisible" at Run-Time.
Or accept that this is not how LabVIEW is intended to be used. It is a LABoratory Virtual Instrument Engineering Workbench, after all, and few Engineers are building devices (virtual or not) that have constantly-changing Operator Interfaces (or Front Panels).
Bob Schor
06-10-2021 10:29 AM - edited 06-10-2021 10:38 AM
Someone on here (pretty sure it was Aristos Queue) had a toolkit for creating front panels. He used a bunch of "decoy" buttons that he'd show and hide as needed. Adding new buttons actually just added pictures to a picture control, but clicking those sections made the "decoy" button appear under it so it looked like there was a whole lot of buttons. It worked decently well but I don't think he quite finished it, and I'll be darned but I can't find it right now. It was VERY interesting.
Edit: Found it! Warning: this is a pretty advanced way to make a GUI, but it's VERY flexible. I wish this was native to LabVIEW. I think NXG had this, or was planned to have it, but that got scrapped.
06-10-2021 01:22 PM
Ya mean like this?
06-11-2021 02:08 AM
@paul_cardinale ha scritto:
Ya mean like this?
Nice, but:
- you need to create controls before running the vi
- it doesn't work with custom controls
- it doesn't work in executables
06-11-2021 02:58 AM
@Bob_Schor ha scritto:Or accept that this is not how LabVIEW is intended to be used. It is a LABoratory Virtual Instrument Engineering Workbench, after all, and few Engineers are building devices (virtual or not) that have constantly-changing Operator Interfaces (or Front Panels).
I really disagree with this sentence. I use labview since 20 years And I've used it for every kind of application: acquisition, automation, databases, office automation, web services.
It's true, It has some limitations due to its roots, but i think It has the potentiality to become a real all purpose language, so, sometimes i ask for some needs hoping in the meanwhile new features are added.
Like scripting 😉
06-11-2021 03:00 AM
06-11-2021 03:07 AM - edited 06-11-2021 03:08 AM
Here it is in LV2015
I added a project and a build specification for an executable.
06-11-2021 03:13 AM