LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Shortcut Menu NAME vs. TAG

Solved!
Go to solution

LV2023.
I have to say that I don't understand menu tags as well as I thought.

I'm trying to make a (dynamic) two-level shortcut menu for a control (in an array of them) by providing a list of "Parent:Child" strings (separated by colon), and a corresponding set of TAG strings of the form "0102"
The "01" represents which parent, and the "02" represents which child the user refers to.

Here's the code in question:

image001.png

The menu LOOKS and OPERATES exactly like I want it. 
But what I want is for the chosen PATH to come back as "Parent:Child"  (I want to put that into the control for the user to see) and I want the TAG to come back as "0102" so that I have indexes into the places I need.

I've tried all sorts of combinations of tag with no name, name with no tag, and cannot get what I want.

Yes, I can work around it, but is there any way to get "Parent:Child" as the PATH and "0102" as the TAG? 

image001.png



The menu LOOKS EXACTLY Like I want

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 5
(104 Views)

Testing the Customizing the Menubar-example i got this as Item-path, so maybe it's your separator that's the problem?

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 5
(77 Views)
Solution
Accepted by topic author CoastalMaineBird

@CoastalMaineBird wrote:


Yes, I can work around it, but is there any way to get "Parent:Child" as the PATH and "0102" as the TAG? 


In short, no. The item path returns tags, not names. You would need to associate the submenu tag with an item name after getting the path using some method (get submenu tag's menu info, check lookup table held in state data, read the data you're indexing, etc) and format the display string after doing so.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 3 of 5
(56 Views)

The item path returns tags, not names.

 

--- That's what seems wrong to me: I imagined the PATH as being the GRANDPARENT : PARENT : CHILD names that get you to the item, and TAG was just an identifier at that path.

But it isn't so.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 5
(42 Views)

The idea behind the design is that tags are the unchanging identifiers for menu items, and the names are user-visible and can be changed without changing the code that processes the item (tag) that was selected.

I feel like a Map between paths and identifiers would be the best solution to this issue. When you create the menus, also create a map that creates the path-to-ID pairings that you want to use later in your code.

0 Kudos
Message 5 of 5
(28 Views)