Re: XForms: three questions

Kris Vanneste (Kris.Vanneste@mailserv.oma.be)
Mon, 23 Feb 1998 08:42:12 GMT

# To subscribers of the xforms list from Kris Vanneste <Kris.Vanneste@mailserv.oma.be> :

Hi,

Browser double clicks:
> >
> > I don't think the single and double click callbacks were really meant
> > to be used together. I suppose one could kluge something to avoid
> > acting on the second single click callback by setting a flag in the
> > double click callback to tell the single click callback to ignore the
> > callback.
>
> That would easily prevent acting on the second single click, but wouldn't
> help to decide whether or not to act on the first one.
>

Apparently I ran into the same problem a while ago. The work-around I
found is to use the same callback function for both the regular and
the double-click callback, but passing a different data value to
distinguish between them:

fl_set_object_callback(obj,module_select_cb,1);
fl_set_browser_dblclick_callback (obj,module_select_cb,2);

void module_select_cb(FL_OBJECT *ob, long data)
{
switch (data)
{
case 1: /* single click */
...
case 2: /* double click */
...
}
}

--

/\ Kris Vanneste (kris.vanneste@oma.be) /\ / \ /\ Dept. of Geodynamics, Section Seismology / \ /\/\/ \ / \ /\/\/ Royal Observatory of Belgium \/ \ / \/ Ringlaan 3 B-1180 Brussel \/ tel. +32-2-3730280 fax. +32-2-3730339 _________________________________________________ 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://bloch.phys.uwm.edu/xforms List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/