Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:53
Stanislav Tartakowski is currently offline Stanislav TartakowskiFriend
Messages: 5
Registered: October 2015
Junior Member
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 08:56]

Report message to a moderator

Previous Topic:How to enable Dark Theme Menus
Next Topic:Breaking Change in GTK-API for x86_64 (v3.116.100) ?
Goto Forum:
  


Current Time: Mon May 06 13:51:58 GMT 2024

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

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

Back to the top