Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Dynamic tooltips

Would it be possible to have Composite.toolTipText() call
Control.getToolTipText() instead of just getting the field? This would
enable us to return dynamic tooltips.
 
IE:
 
public class Composite extends Scrollable {
...
	String toolTipText (NMTTDISPINFO hdr) {
		if ((hdr.uFlags & OS.TTF_IDISHWND) == 0) {
			return null;
		}
		int hwnd = hdr.idFrom;
		if (hwnd == 0) return null;
		Control control = display.getControl (hwnd);
		if (control == null) return null;
		return control.getToolTipText();	// <---
	}
...
}

instead of

public class Composite extends Scrollable {
...
	String toolTipText (NMTTDISPINFO hdr) {
		if ((hdr.uFlags & OS.TTF_IDISHWND) == 0) {
			return null;
		}
		int hwnd = hdr.idFrom;
		if (hwnd == 0) return null;
		Control control = display.getControl (hwnd);
		if (control == null) return null;
		return control.toolTipText;
	}
...
}

Sincerely,

Magne Rasmussen
Invenia AS


Back to the top