Re: XForms: Creating Object

Donald B. Owens (d.b.owens@larc.nasa.gov)
Thu, 11 Jun 1998 09:04:49 -0400

# To subscribers of the xforms list from "Donald B. Owens" <d.b.owens@larc.nasa.gov> :

At 05:43 PM 6/10/98 PDT, you wrote:
># To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve
Lamont) :
>
>Okay, so do I understand correctly that you are NOT using a Canvas
>object? I'm not sure how I got that impression.

Right, I am NOT using a Canvas but my object works much like one so I
called it that in an earlier e-mail. Again, sorry for the confusion.
>
>The key argument passes a *keyboard* key on a FL_KEYBOARD event.
>Otherwise it is meaningless and should not be trusted.

In the chapter in the manual on EVENTS it says under the FL_PUSH and
FL_RELEASE statements that the key parameter returns 1=leftmouse, 2=
middlemouse, 3 = rightmouse. This is definitely the case in version 0.86
but NOT in version 0.88. I tried the method you suggested below but it
still gives me the same problem. I assume that Xforms internals extracts
the value of the key parameter from the XEvents for us.?

Bruce

>
>Here is some skeleton code to handle FL_PUSH and FL_RELEASE events.
>
>static int handle_some_object( FL_OBJECT *ob, int event,
> FL_Coord mx, FL_Coord my,
> int key, void *xev )
>
>{
>
> switch ( event ) {
>
> case FL_PUSH: {
>
> XButtonPressedEvent *xbpevent = ( XButtonPressedEvent *) xev;
>
> do_your_button_press_thing( ..., xbpevent->button );
> break;
>
> }
> case FL_RELEASE: {
>
> XButtonReleasedEvent *xbpevent = ( XButtonReleasedEvent *) xev;
>
> do_your_button_release_thing( ..., xbpevent->button );
> break;
>
> }
>
> }
> return 0;
>
>}
>
> spl
>_________________________________________________
>To unsubscribe, send the message "unsubscribe" to
>xforms-request@bob.usuf2.usuhs.mil or see
>http://bob.usuf2.usuhs.mil/mailserv/xforms.html
>XForms Home Page: http://bragg.phys.uwm.edu/xforms
>List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/
>
>
>
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/