LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV popupmenu: comment vs string

Solved!
Go to solution

Hi,

 

I'd like to create a popupmenu which reacts only on free lables (aka: comments). While I was testing my new menu I realized that my menu item shows up not just for comments but also for string constants and string controls. Is there a way to make a popupmenu working only on comments?

 

(the affected items typedef is set to: Generic/GObject/Decoration/Text/Text)

 

Thanks.

 

1984_2-1697443611445.png 

 

0 Kudos
Message 1 of 3
(577 Views)
Solution
Accepted by topic author 1984

I haven't found a direct way to get this from the reference. AFAIK, you have to do this indirectly...

 

1) Traverse the BD and FP for Text objects, and for each item in your array check if it's in the results.

 

2) Or, for each item, get the owner (it's diagram or pane), get the diagram\pane's decorations, and check the list:

wiebeCARYA_0-1697445165292.png

 

1) might be slower for small arrays on big diagrams, 2) might be slower on larger arrays...

 

 

EDIT: It appears that labels of controls have their control as owner, while controlterminals have the diagram as owner. So, for each object, get the owner, if it's a diagram get it's decorations and check if it's in a list. If the owner is a control, it's obviously not a free label...

Message 2 of 3
(567 Views)

This will work, thanks!

Message 3 of 3
(558 Views)