You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Bill van Melle <bi...@gmail.com> on 2011/02/04 02:14:49 UTC

custom tooltips -- lotsa questions

I noticed Pivot 2.0 lets you make custom tool tips, and I read the simple
example at
http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/tooltips/line_item_tooltip_example.bxml,
but I have several questions yet.

* In the handler for tooltipTriggered, how do I usefully use the x and y?
 They're relative to my component, but opening a Tooltip takes a window, so
the coordinates have to be relative to it.  Is there a way to translate
easily, or do I have to walk up the containment tree, adding in every
parent's getLocation() until I get to the top-level window?

* Can I get rid of the Tooltip's single-pixel black border?  Can I make it
transparent?  (Suppose I'd like my tooltip to have rounded corners, which
the Border component supports, but if I put a Border at the top of my
Tooltip layout, there's still a black outer border with some padding before
we get to my Border.)

* Can I make a tooltip stay open longer than just until the mouse moves.
 E.g., suppose I'd like it to stay open until the mouse moves away from the
tooltip.

* Is any event raised when the tooltip closes?

Actually, that last question is an instance of a more general one I have
about Pivot -- can I find out when a component is removed from the display
hierarchy?  In WPF, all components have Loaded and Unloaded events that fire
when the component is added or removed from the visual tree.  They're useful
for doing things like attaching/detaching other events (listeners) or
starting/stopping background threads that support the component.