New topic: 

MouseUp Events Does Not Work For Me

<http://forums.realsoftware.com/viewtopic.php?t=34539>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        Knightlite          Post subject: MouseUp Events Does Not Work 
For MePosted: Wed Jul 07, 2010 7:04 pm                         
Joined: Thu Apr 26, 2007 7:29 am
Posts: 156
Location: Middlebury, CT                Hi I am trying to make a button using a 
canvas with a Static Label.  When the user clicks the mouse button down 
something happens, when the mouse is released something else happens.  The 
problem is that the MouseUp code does not fire.

To run an experiment you create a textbook and name it txt1.  You drag out a 
Static Label.

In the MouseDown event of the label you type in:

Code:txt1.Text = "Down"

In the MouseUp event you type in:

Code:txt1.Text ="Up"

When you run the program the MouseDown events works, but the MouseUp event 
never fires.

All the other events ie.. MouseDrag, MouseEnter, MouseExit, MouseMove, and 
MouseWheel all work fine. But not MouseUp.

Can anyone tell me why this does not work.

Any help would be appreciated.

Jim   
                             Top                 timhare          Post subject: 
Re: MouseUp Events Does Not Work For MePosted: Wed Jul 07, 2010 7:10 pm         
                
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 8009
Location: Portland, OR  USA                Certain events only become active 
when you return True from MouseDown.  Check the manual.   
                             Top                Knightlite          Post 
subject: Re: MouseUp Events Does Not Work For MePosted: Wed Jul 07, 2010 8:00 
pm                         
Joined: Thu Apr 26, 2007 7:29 am
Posts: 156
Location: Middlebury, CT                Hi Tim,

I did read the manual, and this is what is says:

Quote:The mouse button has been released inside the
window. This event will not occur unless you return
True in the MouseDown event handler. The idea
behind this is that if the mouse was never down, it
can’t be up. This event handler receives parameters
that indicate where the mouse was released in local
window coordinates.

I figured it out.  Didn't get the return true line until now.

If anyone else is wondering about this, to have the MouseUp code work, you have 
to put this code in the MouseDown event for some reason.

Code:txt1.Text = "Down"
Return True

Thanks

Tim   
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to