Re: PV-WAVE WwDrawing and Clicking [message #3277] |
Thu, 29 December 1994 09:57 |
rep2857
Messages: 28 Registered: December 1994
|
Junior Member |
|
|
In article <3dse9q$3k4@ra.nrl.navy.mil>,
<miller@PROBLEM_WITH_INEWS_DOMAIN_FILE> wrote:
> I am trying to get an application to work which will allow the user at
> any time to click in a WwDrawing widget and have an action executed. I
> have tried using WtAddEventHandler and WtAddCallback, but neither one
> works. Here is a sample of what I have done :
> main = WwInit ( "test", "test", tlayout )
> top = tlayout
> draw1 = WwDrawing ( tlayout, 0, "Draw1cb", [ 200, 200 ], [ 200, 200 ] )
> status = WwAddEventHandler ( draw1, ButtonPressMask, "ButtonPressCb"
> )
>
> Pro ButtonPressCB,...
> print, "A button has been pressed"
> end
>
Hi Gordon -
It looks like a couple things are missing here. Your line:
draw1 = WwDrawing ...
should be:
draw1 = WwDrawing ( tlayout, 0, "Draw1cb", [ 200, 200 ], [ 200, 200 ], $
Area=area0)
The "Area" keyword will allow the WtAddHandler to work correctly. area0
is pretty much arbitrary, I just use the window ID in this case.
Now, your WtAddHandler routine would look like this:
status = WtAddHandler(area0, ButtonPressMask, "ButtonPressCb", 0)
Note that this is WtAddHandler. WtAddEventHandler may work fine, but
I'm fairly new to Wave Widgets and have only used WtAddHandler so far.
This assumes that ButtonPressMask has been set somewhere in the test
program and event program. If not, either explicitly set this based on
the value in the wtxlib.pro file, or include the following line which
will define ButtonPressMask before you use it:
@wtxlib
Hope this helps. Feel free to email if you need add'l info.
Mike Schienle Hughes Santa Barbara Research Center
rep2857@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
|
|
|