XForms: pb with slider

jean-pierre Armangau (jean-pierre.armangau@libertysurf.fr)
Wed, 20 Oct 1999 22:59:42 +0200

# To subscribers of the xforms list from jean-pierre Armangau <jean-pierre.armangau@libertysurf.fr> :

This is a multi-part message in MIME format.
--------------F2EF6670B3E41001395FCD1E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,
I've just arrived on the list.
Sorry for the poor quality of my question ...
After compiling the attachment file (bjrxf2.c)
I've got 2 errors messages :
1)- In fl_set_object_label [util.c 43] Setting label of NULL object.
2)- A box "Choice" :XForms Error : fl_set etc....
An idea ?

jean-pierre
--------------F2EF6670B3E41001395FCD1E
Content-Type: text/plain; charset=iso-8859-1;
name="bjrxf2.c"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="bjrxf2.c"

#include <forms.h>
#define DEBUG 1
#ifdef DEBUG
printf("point d'arrèt debug\n");
#endif

FL_FORM *form, *form2;

void yes_callback(FL_OBJECT *ob, long user_data)
{
printf("Yes is pushed\n");
DEBUG
fl_finish();
exit(0);
}

void no_callback(FL_OBJECT *ob, long user_data)
{
printf("No is pushed\n");
fl_show_form(form2, FL_PLACE_MOUSE,FL_TRANSIENT, "Bonjour 2 Fois !");
}

void slider_cb(FL_OBJECT *ob, long data)
{
char str[30];
sprintf(str,"%f",fl_get_slider_value(ob));
fl_set_object_label((FL_OBJECT *)data,str);
}

main(int argc, char *argv[])
{
FL_OBJECT *obj, *sld;
double count;

fl_initialize(&argc, argv, "question", 0,0);

form = fl_bgn_form(FL_FRAME_BOX, 480,120);


fl_add_box(FL_UP_BOX, 160,40,0,0,"Voulez-vous quitter ?");

obj = fl_add_button(FL_NORMAL_BUTTON, 40,70,80,30,"Oui");
fl_set_object_callback(obj, yes_callback, 0);
obj = fl_add_button(FL_NORMAL_BUTTON, 200,70,80,30,"Non");
fl_set_object_callback(obj, no_callback, 0);
sld = fl_add_valslider(FL_HOR_SLIDER, 320,70,120,30, "");
fl_set_slider_bounds(sld,0, 100);
fl_set_object_callback(sld, slider_cb, 0);
/* count = fl_get_slider_value(sld); */

fl_end_form();

/* Définitiopn def a forme 2 */
form2 = fl_bgn_form(FL_UP_BOX, 320,120);


fl_end_form();

fl_show_form(form, FL_PLACE_MOUSE,FL_FULLBORDER, "Bonjour le Monde !");

fl_do_forms();
}

--------------F2EF6670B3E41001395FCD1E--

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/