Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-21-2008, 03:56 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
onMouseEnter/onMouseLeave

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.100;
     
this.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.15;
       
this.15;
       
this.width 32;
       
this.height 32;
       
this.image "mud_sword.png";
     }
   }
}
function 
showtooltip(control) {
  echo(
"show");
}
function 
hidetooltip() {
  echo(
"hide");

__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.