LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Decoration Refnums

Hi everyone, is there a way to read out all of the decoration refnums?  I would like to hide certain "free labels" on the front panel based on certain test conditions.  My problem is I don't know how to identify what each decoration refnum is.  Is there an easy way to do this?

 

Thanks!

0 Kudos
Message 1 of 8
(3,223 Views)

You have to do it programatically.  Look at the OpenG function for Fit Panel to Largest Decoration under the application control palette.  Using the panel reference from a VI (using the property node) you can get the array of decorations (again using a property node).  Then the OpenG function finds the largest one (most area) and sets the front panel to that size.

 

EDIT: Once you have the reference to the decoration you can use the property node Visble to hide or show it at run time.

Message 2 of 8
(3,212 Views)

Traverse for GObjects.vi will find what you're looking for.

 

Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 8
(3,205 Views)

The previous responses should help you find references to all of the Decorations on your Pane (= Front Panel), and you can (probably) filter this list to get just the Text decorations.  To find the specific decoration you are seeking, use the interesting "trick" that for Text decorations, the Text is actually the Label associated with the Decoration.  As far as I can tell (testing only a few Decorations), while all Decorations seem to have a Label Property, you cannot write to this property for, say, a Raised Frame, so you cannot easily identify them by names that you assign to them.  The Text decoration seems to be a happy Exception/Oversight/Fluke.

 

There may be something on the Ideas page to allow associating Labels with Decorations so we can find/manipulate them programmatically -- if there isn't, there should be ...

 

Bob Schor

0 Kudos
Message 4 of 8
(3,190 Views)
I've usually used oth attributes like the relative position of the decoration from another object. Oh and you can probably set and get tags on decorations to identify them.
0 Kudos
Message 5 of 8
(3,179 Views)

@Bob_Schor wrote:

The previous responses should help you find references to all of the Decorations on your Pane (= Front Panel), and you can (probably) filter this list to get just the Text decorations.  [...]


My snippet will find only the Text decorations (free labels); no filtering is required.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 8
(3,126 Views)

Try this.

"If you weren't supposed to push it, it wouldn't be a button."
Message 7 of 8
(3,117 Views)

Thanks for everyones response.  This is some really good information.

0 Kudos
Message 8 of 8
(3,090 Views)