Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Bug with tool tips on menu items(Tooltips are not shown on filtered menu items)
Bug with tool tips on menu items [message #1842917] Tue, 06 July 2021 04:53
Eclipse UserFriend
I have several menuContribution elements for a menu in my plugin.xml. Some of them are not visible at runtime due to visibleWhen condition, which is not evaluated to true. So the list of items in the menu is filtered at runtime. All menuContribution declare toolTip attribute.

Problem is: MenuItem has the field "index" which holds an integer which describes its position in the unfiltered Menu. Now, when hovering the mouse over a menu item, the method

org.eclipse.swt.widgets.Menu.wmTimer(long, long)

is called by eclipse and returns too early on some menu items, because the call

boolean success = OS.GetMenuItemRect (0, selectedMenuItem.parent.handle, selectedMenuItem.index, rect);

is called with a wrong selectedMenuItem.index value (its unfiltered and thus wrong)

Tooltip is only shown if this call succeeds.

When the menu is filetered through visibleWhen conditions, the menu must recompute the indexes of its menu items, else tooltips are not working.

I solved it by setting correct index via reflection but that's kind of a messy hack.

[Updated on: Tue, 06 July 2021 04:56] by Moderator

Previous Topic:How to Display Image in SWT TableColumn Sortable Column
Next Topic:Breaking Change in GTK-API for x86_64 (v3.116.100) ?
Goto Forum:
  


Current Time: Wed Jul 16 11:13:30 EDT 2025

Powered by FUDForum. Page generated in 0.06122 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top