XForms: three questions

Stephen Langer (langer@cam.nist.gov)
Fri, 20 Feb 1998 10:32:46 -0500

# To subscribers of the xforms list from "Stephen Langer" <langer@cam.nist.gov> :

Hi --

I asked a few questions a few weeks ago and didn't get any response.
Since I'm still interested in the answers, I'm reposting them now. The
first two may just be things that aren't clear in the manual. I'm
using version 0.88 on an SGI. Which SGI version doesn't seem to matter.

(1) Browser double clicks

How is one expected to use the browser double click callback? My
program should do different things depending on whether a browser
is single clicked or double clicked, so I install both a regular
callback and a double click callback. But when I double click, the
single click callback is called, then the double click callback, and
then the single click callback again. When the first single click
callback is called, I don't know whether it's a real single click or
not.
The manual says that double clicks make most sense for an
FL_HOLD_BROWSER, which I don't quite understand. If a single click
selects a line but does nothing else, while a double click performs an
action (via the double click callback), then the observed behavior is
ok, although there's not really any reason to invoke the single click
callback at all. But I'm using a browser as a convenient way of
storing a big list of commands, so I'm using an FL_SELECT_BROWSER. Is
that the problem?
The (not terribly satisfactory) workaround that I'm using doesn't
use the double click callback at all. I start an itimer when the
program gets a single click. If the timer expires before another click
comes in, then the timer's signal handler performs the single click
action. The trouble with this is that it precludes other uses of
SIGALRM. If xforms looked for double clicks in the main event loop, it
wouldn't have to use an itimer.

(2) Deleting and freeing grouped objects

What is the correct way to delete and free grouped objects? Does
deleting or freeing a group also delete and free the objects in the
group, or does each object have to be deleted and freed separately?
Does the order matter?

/* group "group" contains objects "obj1" and "obj2" */
fl_delete_object(group); /* does this delete obj1 and obj2 too? */
fl_delete_object(obj1); /* is this needed? */
fl_delete_object(obj2); /* is this needed? */

fl_free_object(group);
fl_free_object(obj1); /* is this needed? does it have to be done before
freeing the group? */
fl_free_object(obj2); /* ditto... */

(3) Spurious callbacks

Mike Blackwell posted about a mysterious crashing bug in the SGI 0.88
version, having to do with input objects. TC responded that that
problem may be fixed in 0.88.1. I'm seeing behavior in 0.88 that is
vaguely similar, and I wonder if it could be the same bug. Since I was
hoping to release this software soon, I'd really like to know if
there's a chance that the bug will be fixed if I wait for 0.88.1, or
if I have to look elsewhere. The code is very large and I haven't been
able to find a simple example that demonstrates the same behavior,
unfortunately. Version 0.81 didn't have the same problem, namely:
I have input objects in groups. The forms have a bunch of buttons,
sliders, and canvases on them, and the groups contain buttons, inputs,
canvases, and text. **When a group is hidden, the callback for the
first input in the group is invoked.** dbx reports that
fl_hide_object() is calling lose_focus(), and lose_focus() is calling
the input object's callback.

Many thanks for any advice!

-- Steve

-- 
-- EMail: stephen.langer@nist.gov                    Phone: (301) 975-5423 --
-- WWW:  http://math.nist.gov/mcsd/Staff/SLanger/    Fax:   (301) 990-4127 --
-- Mail: Building 820 Room 365; NIST; Gaithersburg, Md          20899-0001 --
_________________________________________________
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/