LabVIEW Idea Exchange

Showing results for 
Search instead for 
Did you mean: 

Integrated Structure Labels

Status: Completed
Available in LabVIEW 2012

I think structures should have a better label system. Currently I use free labels of the same color as the loop which looks great and makes the code easy to read and debug. But if I resize my loop I have to manually resize the label as well. I think this should be built into a right-click option.


(structure) rick-click » visible items » Structure label


Integrated Structure Labels.PNG


Hi guys,


I am currently working on speccing out this idea. There is one issue I have run into which I'd like to get some of your feedback on. As you can see in the For Loop example above, the "N" count terminal actually overlaps the label. This is a problem, as you can actually wire out of this terminal. This implies that any code inside the structure could overlap the label, which obviously would cause visibility issues. Additionally, we must consider the case where the user has increased the height of the label with carriage returns.


The current idea I have is that the structure label would increase the height of the structure when added or when grown through carriage returns (as opposed to growing in and possibly squishing the code in the structure in. In the case of the For Loop, it would look something like this:




As you can see in this picture, the label is above the for loop iterator. The second image demonstrates what it would look like if the label was two lines high. I realize that this looks strange since we are all used to the count terminal being in the upper left corner, however I feel like this is the best solution since technically that count terminal is part of the code. The idea here is that the structure label should feel like a part of the frame.


Does anyone have any objections to this? Obviously I am open to other suggestions on how to deal with this issue.

Active Participant

I'm fine with the N terminal being moved down a bit (I rarely use it anyway! Smiley Very Happy). However, I think I would prefer the labels growing downward instead of up when added or extended via carriage returns. That seems more natural for me, and it matches with how other objects grow (comments, string constants, etc.).


However, since this is a completely new feature, I have no idea which one I'll actually like more Smiley Tongue. So perhaps make it an option? Or get me into the 2012 beta Smiley Very Happy

Trusted Enthusiast

I actually like the look of the "as-drawn" version better, with the count terminal overlapping the label a little bit.  Besides, what is wrong with pinning the label to the bottom of the structure if desired?


I am curious how it looks and feels with wires, or does it effectively stop you from wiring from the top.


You can do much worse things with the For Loop (like hide code entirely) than putting a little code on top of the label, so I wouldn't necessarily want it to grow outward.  Besides, the "make space" feature scares me and this would be one more place it is used.  At least growing downward only squishes the code inside the loop, thus limiting the damage.


Personally, I would prefer the ability to have a few options:

1) Stick to top or bottom

2) Snap text to center/left/right

3) Have the background optionally size to text or size to the structure.


This way I could also have labels which stuck in position, shared color with the structure border, and still leave room for the count terminal and wires if it looks better.



Active Participant

Just thought of something: why can't the label be in the background, and leave the N terminal where it is?


for loop with background label.png

Knight of NI

I never play around with recoloring structures, but this thread gave an idea on how you could really mess with people.  Recolor a while loop or for loop border white and you'd really blow people's minds.


What is going on here?




Sorry for going a bit off topic.  I kind of liked the different look of the light blue border for the For Loop.  Occasionally I'll see posted code where someone recolored the background to distinguish it.  It just got me thinking of how it could be abused.


dthor: I think the problem with having the label grow inward and underlap code is that if you happen to have code over that text, both the label and the code could become unreadable very quickly. It looks good in your example but what happens if the text goes over to the side or that node was moved up higher? You would have to do alot of finagling around to get it readable. 


Currently I do plan on having the option to move the label to different sides of the structure. I know that growing down feels more natural as you type, but we don't really have a way of squishing code down inside the structure and the underlapping has the problems noted above. If the structure grows up and you don't want it to push everything around, you can always disable Auto Grow on the structure itself.

Active Participant

Yes, having the label behind code can make it the label unreadable, but I don't see any reason why the structure label would be big enough for that to happen. In my extreme-case example, I find the code to still be legible (granted, not ideal, but not *too* difficult to read), and I'm able to get the general idea of the text behind it (perhaps that's because I wrote it).

for loop with background label 2.png


Really, I don't see any reason why any label, no matter how big or small the structure is, would be longer than 2 lines. If you need more than that then you probably should have a floating comment box somewhere else.


Also, a possible remedy for that could be to limit the vertical size of the label, to, say, 1/4th or 1/2 of the height of the structure. Labels longer than that start to scroll.




That would definitely mitigate the problem, but consider the case when you are moving nodes around within the structure. For example select a node inside a structure with autogrow on and hold the up arrow. The node pushes the boundaries of the structure up to make room for itself. If we allow underlap, it will overlap the label before it pushes the edge of the structure up. Perhaps this is not a common use case but it makes it feel a little shabby.


Regardless of any steps we take to mitigate it, any solution which allows the label to underlap would by definition allow nodes and wires to overlap text.

Active Participant

Regardless of any steps we take to mitigate it, any solution which allows the label to underlap would by definition allow nodes and wires to overlap text.

True. Perhaps it is just easier to move the N terminal below the structure label.

NI Employee (retired)
Status changed to: In Development