I'm aware that it has several functions that roughly parallel those of a typical Region, but are not defined within the FrameXML- like I said, I've dug through that. And I've checked WoWWiki, where someone has made an attempt to document the behavior in Lua-ish psuedo-code, but all that contains in terms of defining the size of the tooltip is the following:
LayoutTooltip(); -- Resize tooltip based on shown fontstrings
Which tells me something, but not much. I know experimentally that the width is, at least in some cases, derived from the length of the string supplied to GameTooltip:SetText. Those cases seem to be those in which this first string (StringA, for convenience) is the longest string to be displayed on the tooltip. However, if StringA is shorter (in pixel-width, not characters) than a string supplied to an AddLine call, the tooltip appears to expand itself, within limits, to adapt. That limit appears to be the greater of either the pixel-width of StringA, or a value, somehow derived from the other strings, that hovers around 235px. However, in this case, the final argument to AddLine (wrapLine) is ignored- all strings after StringA will be wrapped to the tooltip's width, period. Even if all extra strings are told not to wrap, some shorter width is chosen and the strings wrap anyways.
And why this matters to me? I'm trying to build a tooltip with a relatively short first line, but with lengthier secondary lines, and those extra lines are getting wrapped despite my explicit instruction not to. The only solution I can see at this point is a rather hit-and-miss tactic of guessing SetWidth parameters for the Tooltip and it's FontStrings, which is obviously quite ugly and imprecise.
So, my question:
Is there any way to force a GameTooltip to determine its width using the un-broken length of the longest string it contains?