/** * Sets the receiver's tool tip text to the argument, which may be null indicating that the * default tool tip for the control will be shown. For a control that has a default tool tip, such * as the Tree control on Windows, setting the tool tip text to an empty string replaces the * default, causing no tool tip text to be shown. * * <p>The mnemonic indicator (character '&') is not displayed in a tool tip. To display a * single '&' in the tool tip, the character '&' can be escaped by doubling it in the * string. * * @param string the new tool tip text (or null) * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * </ul> */ public void setToolTipText(String string) { checkWidget(); if (parent.toolTipText == null) { Shell shell = parent._getShell(); setToolTipText(shell, string); } toolTipText = string; /* * Since tooltip text of a tool-item is used in overflow * menu when images are not shown, it is required to * reset the proxy menu when the tooltip text changes. * Otherwise, the old menuItem appears in the overflow * menu as a blank item. */ if ((style & SWT.DROP_DOWN) != 0) { proxyMenuItem = 0; proxyMenuItem = OS.gtk_tool_item_retrieve_proxy_menu_item(handle); OS.g_signal_connect( proxyMenuItem, OS.activate, ToolBar.menuItemSelectedFunc.getAddress(), handle); } }