I'm trying to create a tooltip GUI. To do this, I'm using onMouseEnter/onMouseLeave. However, they aren't working the way I had hoped they would.
It seems that onMouseLeave is called when the mouse simply
moves inside the GUI control, rather than actually leaving the control itself. My guess is that it's because the mouse is entering a child control. (See sample code attached.)
Is there a possibility of onMouseEnter/onMouseLeave to ignore child controls, if they are not used in the child control itself? I could use a timeout, but I'd really rather not.
Example code:
PHP Code:
function onCreated() {
new GuiBitmapBorderCtrl("ItemBox1") {
this.profile = GuiGrayBitmapBorderProfile;
this.canmove = true;
this.canresize = false;
this.x = 100;
this.y = 100;
this.width = 64;
this.height = 64;
this.archname = "ironsword";
this.count = 1;
this.fullname = "Iron Sword";
thiso.catchevent(this.name, "onMouseEnter", "showtooltip");
thiso.catchevent(this.name, "onMouseLeave", "hidetooltip");
new GuiShowImgCtrl("ItemBox1Img") {
this.x = 15;
this.y = 15;
this.width = 32;
this.height = 32;
this.image = "mud_sword.png";
}
}
}
function showtooltip(control) {
echo("show");
}
function hidetooltip() {
echo("hide");
}