LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Center subVI over caller

I would like my dialog box to appear centered over the VI that calls it.  I came up with the attached VI's, but surely there must be a better way?
--
Tim Elsey
Certified LabVIEW Architect
Download All
0 Kudos
Message 1 of 5
(3,545 Views)
Why do you think that's a bad way? It's platform-independent. If you're willing to limit it to a specific OS you can use OS calls to center windows.
0 Kudos
Message 2 of 5
(3,519 Views)

Any time you are combining propery nodes with 'Unbundle By Name' it is bound to look a little hairy on the BD.  The method is fundamentally sound and platform independent, so I would call it ugly, but not bad.  You could do some minor tweaks to eliminate a couple math operations, but I would simply suggest writing a subVI or two to ease the pain.  If you dig through the LV folder, they have a couple of subVIs that do most of the job, password protected since it probably looks a lot like yours and they too were embarassed.

 

 

 

 

Message 3 of 5
(3,512 Views)
I know its sound and platform independent and all that jazz, but like Darin says, it gets ugly.  And I'm doing pretty much the same thing on two different references, so I made a for loop to do it, but it got uglier so I went back.  I thought there might be some secret properties or something I didn't know of to make the math unnecessary.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 4 of 5
(3,500 Views)

You can hide the math, but not from the math.  There are other properties available to get the size of the window, but getting to them requires more property nodes which is uglier than the math.  You can make things slightly more compact by hiding the names in the property nodes, but in reality it is what it is.  If that is the ugliest thing you've ever created, you're doing better than I am.  You should see some of my scripting tools.

 

Want it to look nice, select it all, Create SubVI, then make a nice icon.  Think of it as your little sausage factory, nice and tidy on the outside, but do you really want to see what goes on inside?

0 Kudos
Message 5 of 5
(3,477 Views)