Variable in tooltip/hint for a LineEdit?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sylkie

Is it even possible? The Engine Documentation shows no method of assigning a variable value to a LineEdit tooltip, and “hint” isn’t even a property that can be addressed. I’d like to display the overly long contents of a label without having to expand the entry box size.

I’m not sure I understand what you are trying to do, but the LineEdit node is a single line one, so I wouldn’t expect that you would use it for long text, maybe TextEdit would be better in that case.
About hints, I believe what you are looking for is a tooltip and that seems to implemented in the base Control node, link.

tastyshrimp | 2019-12-17 19:59

Yes, in the industry we call them tooltips, in Godot we call them hints. A TextEdit is unsuitable due to space constraints. LineEdit is sufficient, but I do not want to set it to grow to accommodate text. Showing the expanded text in a tooltip would suffice (there are many applications, Microsoft and other, that use this technique) I was just hoping there might be some obscure way of accomplishing this. I’m beginning to think I will have to create a homebrew solution. Thank you for your input!

Sylkie | 2019-12-17 21:32

So the default tooltip implemented by the control node does not do what you want I assume, the one i linked in to the docs?
If that is the case, with a quick google search you can see a few homebrew implementations, like this or this. Good luck!

tastyshrimp | 2019-12-17 21:41

That is pretty much what I was thinking I might have to do! I was just looking for the lazy way. Thanks for the links. I’m thinking it might be a useful technique in future projects, so I’m thinking the separate scene may be the most versatile solution. Hmmm… I can already see some distinct advantages to taking this route… like tooltips on steroids! LOL! Cheers!

Sylkie | 2019-12-17 22:05

:bust_in_silhouette: Reply From: tastyshrimp

This answer is a copy from the comments so we can have an “accepted” answer and make it easier to find for the next person that needs this.

About hints, there is a tooltip implemented in the base Control node, link.
If you need something more complex, with a quick google search you can see a few homebrew implementations, like this or link. Good luck!