Re: XForms: Creating Object

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 10 Jun 98 17:43:29 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Apologizies for not explaining my problem correctly.
>
> The following is what I am really doing. I am creating an object EXACTLY
> like the example in the manual in Chapter 24 which shows how to create a
> simple object class colorbox. The only additional thing I have implemented
> is the use of the mouse buttons. ...

Okay, so do I understand correctly that you are NOT using a Canvas
object? I'm not sure how I got that impression.

The key argument passes a *keyboard* key on a FL_KEYBOARD event.
Otherwise it is meaningless and should not be trusted.

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/