Angus Leeming wrote:
On Sunday 20 October 2002 12:45 pm, Rob Lahaye wrote:

Long tooltips strings are not wrapped with a certain lengths
anymore. E.g. try the Graphics dialog/File/Do not unzip. This
long tooltips text shoots off my display!!
Add a print statement to the end of formatted() in xforms_helpers.C
to check that the string has line breaks inserted as expected.
Done that. Result: formatted() does its job properly, but when
the tooltip text is displayed, the formatting has disappeared.
I found following in Tooltips.C::Tooltips::init():

	string const str = trim(tip);
	if (str.empty())
		return;

	// Store the tooltip string
	tooltipsMap[ob] = formatted(str, 400);

	// Set the tooltip
	char const * const c_str = enabled_ ? str.c_str() : 0;
	fl_set_object_helper(ob, c_str);


The string stored in tooltipsMap[ob] is formatted, but NOT the one
that is given to fl_set_object_helper() !?!?!

Should we instead have something like:

	string tooltipText = formatted(str, 400);
	tooltipsMap[ob] = tooltipText;
	fl_set_object_helper(ob, tooltipText.c_str());

(of course wrapped up in the same "enabled_" conditional as above!).


As for those who say that tooltips shouldn't be long, then come up with a working What's This implementation or stop revisiting old converstations. Or, indeed switch to Qt.
If "shorter tooltips" is going to be a new policy, then first
shorten the tooltips, before removing the wrapping ;).
Especially in a feature freeze situation.
Anyway, I don't think this was intentionally, but rather a silent
bug introduced recently.

Personally, I like the somewhat longer explanations, instead of
meaningless criptic one liners.

Regards,
Rob.

Reply via email to