LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create and resize button in a running VI


@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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 21
(2,213 Views)
The problem Is that I could need hundreds of them 😞
0 Kudos
Message 12 of 21
(2,207 Views)

"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

0 Kudos
Message 13 of 21
(2,202 Views)

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.

 

https://forums.ni.com/t5/LabVIEW/A-more-successful-experiment-in-creating-compositable-user/td-p/127...

0 Kudos
Message 14 of 21
(2,189 Views)

Ya mean like this?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 15 of 21
(2,168 Views)

@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

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 16 of 21
(2,134 Views)

@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 😉

0 Kudos
Message 17 of 21
(2,121 Views)
It's in v18, I use 17 😞
0 Kudos
Message 18 of 21
(2,120 Views)

Here it is in LV2015

I added a project and a build specification for an executable.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 19 of 21
(2,116 Views)
Thank you! It could be a nice staring point 😉
0 Kudos
Message 20 of 21
(2,112 Views)