Re: XForms: problems with fl_get_choice_text

Bjoern Fuerst (
Wed, 05 Nov 1997 18:56:26 +0100 (CET)

To subscribers of the xforms list from Bjoern Fuerst <> :

On 05-Nov-97 Steve Lamont wrote:

>I suspect the source of your problem is trying to do *anything* other
>than set a flag from within a signal handler. Making Xlib calls (or
>XForms calls, which are merely sophisticated wrappers around Xlib
>calls) is the Kiss of Death[tm]. X is not reentrant and making an X
>call from an interrupted X call will cause the sort of bogosity you
>You can do the same thing by either using an idle callback (see
>fl_idle_callback() and fl_set_idle_delta()), by using a timeout
>(fl_add_timeout()), or by registering a signal handler
>I list those in more or less my own order of preference. I'd probably
>use the idle callback if I had no other idle tasks I needed to perform
>in the application.
> spl

Thank you for the quick (and understandable!) answer Steve,

i changed the code as you said to the following:

int redraw() !! nothing important changed here !!
sscanf((char *)datum(),"%*s %s %d %s %d",monat,&tag,time_string,&jahr);
sscanf((char *)time_string,"%d:%d:%d", &stunde_start, &minute_start, &sekunde

printf("Pointer-Value: %d\n",MainForm->dimension_choice);

stunde_start, minute_start, sekunde_start,
11, 25, 00,
(char *)fl_get_choice_text(MainForm->dimension_choice),
(char *)output);



and in main():


I hope that is what you meant, but I'm sorry to say that it still doesn't work.
But OK, I'm getting a little closer, at least I think so.

See, I added a line in redraw ():

printf("Pointer-Value: %d\n",MainForm->dimension_choice);

so what happens is just what I wrote in the first mail. Everything works fine.
Output all right, depending on the choices you make.
the printf outputs say a



Touching a key on the active Window results in the mentioned segmentation fault
AND the last output of the printf was say


That's it! The program just lost the pointer, somewhere, somehow. I've got still
no idea what happens.

Perhaps I should say that I "made" the form using the fdesign and importing the
.h file while linking everything together with something like

all: ToGo

ToGo: ToGo.o ToGo_design.o Julian.o
@echo "Linking ToGo ... "
gcc $(GCCOPT) $(GCCLIB) -o ToGo ToGo.o ToGo_design.o Julian.o

I checked the demos that come with the XForms but none of them does it that way,
in these, everything is in the .c-file, could that be the point?

I'm sorry not be able to give more information, perhaps someone got some hints.


best regards


E-Mail: Bjoern Fuerst <>
Date: 05-Nov-97
Time: 18:56:28
Bjoern Fuerst Proud Member of the WWW-A2-Team
A2 Collaboration Phone: ++49/6131/39-5899
Institut fuer Kernphysik Fax: ++49/6131/39-2964
Johannes Gutenberg Universitaet WWW:
Johann-Joachim-Becher Weg 45
D-55099 Mainz
"Nice joke Scotty - now beam up my clothes"
To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: