Mouse tracking, Buttons and ToolTips

  • CGUI provides a method for tracking the current mouse position.
  • The position is relative to the viewable area, or adjusted to the object under the mouse.
  • Buttons highlight when the mouse is over them.
  • Change their appearance when they are depressed.
  • May (like all widgets) have tooltip text associated with them.
      var controller = new Object();
      controller.handleEvent = function(evt) {
        var target = CGUI.getJSRef (evt.target);
        alert (target.toString());
      }
      var button = new Button (60, 15, "Absolute", controller);

      var tt = new Tooltip(button3, 0, 15, "I'm tooltip Text");
      tt.addToParent(CGUI.root);