Re: XForms: pb with slider

jean-pierre Armangau (jean-pierre.armangau@libertysurf.fr)
Thu, 21 Oct 1999 15:55:39 +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.
--------------E3DAB6D9C63516634CD5052A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

Steve Lamont wrote:
>

>
> > After compiling the attachment file (bjrxf2.c)
>
> Does the attachment file actually compile? I had to fix two syntax
> errors before I could get it to compile:

no, i'm soory. the attach file wasn't the good one.

> > #define DEBUG 1
> > #ifdef DEBUG
> > printf("point d'arr=E8t debug\n");
> > #endif
>
> This is illegal. Do you mean to define
>
> #ifndef DEBUG
> #define DEBUG printf("point d'arr=E8t debug\n");
> #endif
>
the debug code (not completed)....
With the former code (attach) i've lose the application trying to move
the cursor of the slider with no error message. I've tried to fix it 1)-
adding callback, 2)- debug code.

The attached file is the good one.
Why is closing my application trying to clic in slider

Thank's 4 u help

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

#include <forms.h>

FL_FORM *form, *form2;

void yes_callback(FL_OBJECT *ob, long user_data)
{
printf("Yes is pushed\n");
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 !");
}

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);

fl_end_form();

/* Définition de forme 2 */

form2 = fl_bgn_form(FL_UP_BOX, 320,120);
sld = fl_add_valslider(FL_HOR_SLIDER,40 ,70,120,30, "");
fl_set_slider_bounds(sld,0, 100);
count = fl_get_slider_value(sld);

fl_end_form();

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

fl_do_forms();
}

--------------E3DAB6D9C63516634CD5052A--

_________________________________________________
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/