Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Having a Shell follow a target Control around(How to implement this using ControlListener, PaintListener, and friends)
Having a Shell follow a target Control around [message #1753714] Thu, 09 February 2017 09:15
Andreas Sewe is currently offline Andreas SeweFriend
Messages: 109
Registered: June 2013
Senior Member

I am trying to implement a Shell (think: extended tooltip) that follows another Control around even if the "target" is resized or moved. Using a ControlListener for this works fine if the target is resized, but doesn't always work when it is moved around: When the target's parent moves, the target itself doesn't move relative to the parent, but it clearly moves from the user's perspective. Hence the tooltip should move as well.

So far, I have found to "solutions" to this problem, none of which is great.

  1. Register ControlListeners to all ancestors of the target control.
  2. Use a PaintListener instead of a ControlListener.
The first solution requires not only a ton of listeners but also triggers on many moves that don't affect the target because an intermediate Control has a layout that insulates the target from the move's effects.

The second solution also triggers too often, as paints may be caused by something other than a move or resize.

Is there a better solution?
Previous Topic:Deploying SWT Application on MacOSX Sierra
Next Topic:Dragging Tabs - don't work at 4k? (linux)
Goto Forum:

Current Time: Fri Dec 15 14:17:47 GMT 2017

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

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