XForms: Creating Object

Donald B. Owens (d.b.owens@larc.nasa.gov)
Wed, 10 Jun 1998 18:29:55 -0400

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

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. The problem occurs in the following
function:

static int handle_jwin(FL_OBJECT *ob, int event, FL_Coord mx, FL_Coord my,
int key, void *xev )
{
switch (event){
case FL_DRAW:
jw_make_display(ob);
break;
case FL_PUSH:
case FL_MOUSE:
case FL_RELEASE:
switch(key){
case 1:
OB->b1_cb(ob,event,mx,my);
break;
case 2:
OB->b2_cb(ob,event,mx,my);
break;
case 3:
OB->b3_cb(ob,event,mx,my);
break;
}
return 1;
case FL_KEYBOARD:
OB->key_cb(ob,key,mx,my);
break;
case FL_FREEMEM:
fl_free(ob->spec);
return 0;
}
return 0;
}

When I receive the key = 1 from the left mouse button the appropriate call
back is called and as long as I hold down the mouse button I draw a box.
When I release the left mouse button what should be sent to the above
function is key 1 and event = FL_RELEASE. What I get instead is key = 0
and event = FL_RELEASE. This happens randomly because sometimes I do get
key = 1 and event = FL_RLEASE. So the event sent is always correct but the
key is not.
What is not understood is why I do not get this when I use version
0.86.When I use version 0.86 I always get key = 1 and event = FL_RELEASE.

Thanks for all of the help.

At 10:49 AM 6/10/98 PDT, you wrote:
># To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve
Lamont) :
>How are you processing the events? With a preemptive or postemptive
>callback?
>
>The canvas installs its own preemptive callback handler and if you
>install one as well, this may lead to bogosity -- in fact, I'm not
>sure what would happen.
>
> 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/