Software Archive
Read-only legacy content
17061 Discussions

WaitOnMouseEvent

Intel_C_Intel
Employee
209 Views
I use WaitOnMouseEvent in a graphics program so that the user can look at a graph and click on the window when he's ready to proceed. After the plotting is finished, I use something like the following:

ikey = 9
istat = WaitOnMouseEvent( ikey, ibut, ix, iy )

In one application, it works right the FIRST time, but always
freezes on the second plot (which is done in a new window). It works in other applications. Does anyone have any idea what I could have done to make this happen? I am at a total loss.

--Andy Milman :: amilman@ieee.org
0 Kudos
2 Replies
isn-removed200637
209 Views
According to the documentation , quote


WAITONMOUSEEVENT does not return until the specified mouse input is received from the user. While waiting for a mouse event to occur, the status bar changes to read "Mouse input pending in XXX " where XXX is the name of the window. When a mouse event occurs, the status bar returns to its previous value.



Note that a mouse event must happen in the window that had focus when WAITONMOUSEEVENT was initially called. Mouse events in other windows will not end the wait. Mouse events in other windows cause callbacks to be called for the other windows, if callbacks were previously registered for those windows.



unquote. What status bar message do you get? It should tell you what's happening. Also, why not use the
mouse event symbolic constants as the first argument, shown here extracted from DFLIB.F90?

.
 
      INTEGER MOUSE$LBUTTONDOWN,MOUSE$MOVE,MOUSE$LBUTTONUP,             & 
     & MOUSE$RBUTTONDOWN,MOUSE$RBUTTONUP,MOUSE$LBUTTONDBLCLK,           & 
     & MOUSE$RBUTTONDBLCLK,MOUSE$KS_LBUTTON,MOUSE$KS_RBUTTON,           & 
     & MOUSE$KS_SHIFT,MOUSE$KS_CONTROL,MOUSE$BADUNIT, MOUSE$BADEVENT 
 
      PARAMETER(MOUSE$LBUTTONDOWN           = #1) 
      PARAMETER(MOUSE$LBUTTONUP             = #2) 
      PARAMETER(MOUSE$LBUTTONDBLCLK         = #4) 
      PARAMETER(MOUSE$RBUTTONDOWN           = #8) 
      PARAMETER(MOUSE$RBUTTONUP             = #10) 
      PARAMETER(MOUSE$RBUTTONDBLCLK         = #20) 
      PARAMETER(MOUSE$MOVE                  = #40) 
 
      PARAMETER(MOUSE$KS_LBUTTON            = #1) 
      PARAMETER(MOUSE$KS_RBUTTON            = #2) 
      PARAMETER(MOUSE$KS_SHIFT              = #4) 
      PARAMETER(MOUSE$KS_CONTROL            = #8) 
 
      PARAMETER(MOUSE$BADUNIT               = -2) 
      PARAMETER(MOUSE$BADEVENT              = -1) 
0 Kudos
david_jones
Beginner
209 Views
You have not said what you have done regarding REGISTERMOUSEEVENT, or quite waht you mean by "new window". It may be necessary to re-register the mouse events if you close a window and open it with the old unit number.
0 Kudos
Reply