[Project_owners] Tooltip position

Didier Ernotte didier at ernotte.com
Sun Mar 20 18:50:21 EST 2005


Here is some code to test the tooltip. I can't make to tooltip locate
using the position attribute. It always appears a few pixels below the
pointer. What's wrong ?
Thanks!

Didier

<?xml version="1.0"?>

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window id="example-window" title="Example 6.8.1"
        xmlns:html="http://www.w3.org/1999/xhtml"
       
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <popupset id="mainPopupSet">
    <tooltip id="ttip" orient="vertical" position="before_start">
      <label value="help1"/>
      <label value="help2"/>
    </tooltip>
  </popupset>
  <label value="test tooltip" id="test"/>
  <label value="test tooltip 2" id="test2"/>
  <label value="test tooltip 3" id="test3" tooltip="ttip"/>
  <label value="test tooltip 4" id="test4" tooltip="ttip"/>
  <label value="test tooltip 5" id="test5" tooltip="ttip"/>
<script  type="application/x-javascript">
<![CDATA[
//-----------------------------------------------------------------------------------------------------

try
{
        var tooltip = document.createElement("tooltip");
        tooltip.setAttribute("id","inforss.headline.tooltip");
        var toolHbox = document.createElement("vbox");
        tooltip.appendChild(toolHbox);
        var toolLabel = document.createElement("label");
        toolLabel.setAttribute("value","description");
        toolHbox.appendChild(toolLabel);

        toolLabel = document.createElement("label");
        toolLabel.setAttribute("value","headline.title");
        toolHbox.appendChild(toolLabel);
        toolLabel = document.createElement("label");
        toolLabel.setAttribute("value","hello");
        toolHbox.appendChild(toolLabel);
        tooltip.setAttribute("noautohide", false);
        tooltip.setAttribute("position", "overlap");
        tooltip.position = "overlap";
        document.getElementById("example-window").appendChild(tooltip);
      document.getElementById("test").setAttribute("tooltip", "ttip");
      document.getElementById("test2").setAttribute("tooltip",
tooltip.getAttribute("id"));
}
catch(ex)
{
  alert(ex);
}

]]>
</script>

</window>




More information about the Project_owners mailing list