show forms

Jesus Revilla (Jesus@electron.icmm.csic.es)
Mon, 28 Apr 1997 12:37:17 +0200

To subscribers of the xforms list from Jesus Revilla <Jesus@electron.icmm.csic.es> :

I have the next code, and I can=B4t display the form, I don=B4t know what=
happen:

unsigned int main (unsigned int argc, char *argv [])
{
FD_semgui *fsemgui;
Display *fDisplay;

fDisplay =3D fl_initialize(&argc,argv,"Unidad de SEM",0,0);
if (fDisplay =3D=3D NULL)
{
printf("%s: Can=B4t open display"\n", argv [0]);
exit(2);
}
fsemgui =3D create_form_semgui();
=20
if (fsemgui =3D=3D NULL)
{
printf ("%s: Can=B4t Create form\n", argv [0]);
exit (1);
}
=20
=20
fl_show_form(fsemgui,FL_PLACE_MOUSE,FL_TRANSIENT,"SEM Unit Version 2.0");

fl_do_forms();
return(0);
}

FD_semgui *create_form_semgui(void)
{
FL_OBJECT *obj;
FD_semgui *fdui =3D (FD_semgui *) fl_calloc(1, sizeof(*fdui));

if (fdui =3D=3D NULL)
{
puts("NO hay memoria para la form");
exit(3);
}
fdui->semgui =3D fl_bgn_form(FL_NO_BOX, 770, 700);
obj =3D fl_add_box(FL_DOWN_BOX,0,0,770,700,"");
fl_set_object_color(obj,FL_DARKCYAN,FL_COL1);
obj =3D fl_add_box(FL_UP_BOX,0,0,770,40,"");
obj =3D fl_add_pixmap(FL_NORMAL_PIXMAP,10,70,512,512,"");
fl_set_object_boxtype(obj,FL_DOWN_BOX);
fdui->Medir =3D obj =3D
fl_add_lightbutton(FL_PUSH_BUTTON,20,600,100,30,"Medir");
fl_set_object_callback(obj,Accionar,0);
fdui->Imprimir =3D obj =3D
fl_add_button(FL_NORMAL_BUTTON,130,600,100,30,"Imprimir");
fl_set_object_callback(obj,Imprimir,0);
fdui->Salvar =3D obj =3D fl_add_button(FL_NORMAL_BUTTON,20,650,100,30,"
Salvar");
fl_set_object_callback(obj,Salvar,0);
fdui->Salir =3D obj =3D=
fl_add_button(FL_NORMAL_BUTTON,130,650,100,30,"Salir");
fl_set_object_callback(obj,Salir,0);
obj =3D fl_add_frame(FL_ENGRAVED_FRAME,250,600,130,80,"");
fdui->Intensidad =3D obj =3D
fl_add_slider(FL_VERT_NICE_SLIDER,525,70,20,500,"");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_CHARTREUSE);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj,Luces,1);
fl_set_slider_precision(obj, 1);
fl_set_slider_return(obj, FL_RETURN_CHANGED);
fdui->Contraste =3D obj =3D=
fl_add_slider(FL_VERT_NICE_SLIDER,550,70,20,500,"");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_CHARTREUSE);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj,Luces,2);
fl_set_slider_precision(obj, 1);
fl_set_slider_return(obj, FL_RETURN_CHANGED);
fdui->Rojo =3D obj =3D=
fl_add_slider(FL_VERT_NICE_SLIDER,575,70,20,500,"");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_CHARTREUSE);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj,Luces,3);
fl_set_slider_precision(obj, 1);
fl_set_slider_return(obj, FL_RETURN_CHANGED);
fdui->Verde =3D obj =3D=
fl_add_slider(FL_VERT_NICE_SLIDER,600,70,20,500,"");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_CHARTREUSE);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj,Luces,4);
fl_set_slider_precision(obj, 1);
fl_set_slider_return(obj, FL_RETURN_CHANGED);
fdui->Azul =3D obj =3D=
fl_add_slider(FL_VERT_NICE_SLIDER,625,70,20,500,"");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_CHARTREUSE);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj,Luces,5);
fl_set_slider_precision(obj, 1);
fl_set_slider_return(obj, FL_RETURN_CHANGED);

fdui->PesoBack =3D fl_bgn_group();
obj =3D fl_add_slider(FL_VERT_NICE_SLIDER,715,70,20,500,"B3");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_RED);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_slider_return(obj, FL_RETURN_END_CHANGED);
obj =3D fl_add_slider(FL_VERT_NICE_SLIDER,665,70,20,500,"B1");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_RED);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_slider_value(obj, 0.51);
fl_set_slider_return(obj, FL_RETURN_END_CHANGED);
obj =3D fl_add_slider(FL_VERT_NICE_SLIDER,690,70,20,500,"B2");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_RED);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_slider_return(obj, FL_RETURN_END_CHANGED);
obj =3D fl_add_slider(FL_VERT_NICE_SLIDER,740,70,20,500,"B4");
fl_set_object_boxtype(obj,FL_FRAME_BOX);
fl_set_object_color(obj,FL_BOTTOM_BCOL,FL_RED);
fl_set_object_lcol(obj,FL_RIGHT_BCOL);
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_slider_return(obj, FL_RETURN_END_CHANGED);
fl_end_group();

fdui->Imagenes =3D fl_bgn_group();
fdui->Imagen =3D obj =3D
fl_add_checkbutton(FL_RADIO_BUTTON,257,609,132,24,"Imagen");
fl_set_object_callback(obj,VerImagenes,1);
fdui->Backscaterring =3D obj =3D
fl_add_checkbutton(FL_RADIO_BUTTON,257,629,132,24,"Backscaterring");
fl_set_object_callback(obj,VerImagenes,2);
fdui->Ponderadas =3D obj =3D
fl_add_checkbutton(FL_RADIO_BUTTON,257,649,132,24,"Ponderadas");
fl_set_object_callback(obj,VerImagenes,3);
fl_end_group();

obj =3D fl_add_pixmap(FL_NORMAL_PIXMAP,525,40,20,20,"");
obj =3D fl_add_pixmap(FL_NORMAL_PIXMAP,550,40,20,20,"");
obj =3D fl_add_pixmap(FL_NORMAL_PIXMAP,575,40,20,20,"");
obj =3D fl_add_pixmap(FL_NORMAL_PIXMAP,600,40,20,20,"");
obj =3D fl_add_pixmap(FL_NORMAL_PIXMAP,625,40,20,20,"");

fdui->xyposicion =3D fl_bgn_group();
obj =3D fl_add_valslider(FL_HOR_SLIDER,410,620,130,20,"");
fl_set_object_color(obj,FL_COL1,FL_RED);
fl_set_object_lalign(obj,FL_ALIGN_LEFT);
fl_set_slider_precision(obj, 3);
fl_set_slider_value(obj, 0.201);
fl_set_slider_return(obj, FL_RETURN_END_CHANGED);
obj =3D fl_add_valslider(FL_HOR_SLIDER,410,650,130,20,"");
fl_set_object_color(obj,FL_COL1,FL_RED);
fl_set_object_lalign(obj,FL_ALIGN_LEFT);
fl_set_slider_precision(obj, 3);
fl_set_slider_bounds(obj, 0.500, 1.000);
fl_set_slider_value(obj, 0.512);
fl_set_slider_return(obj, FL_RETURN_END_CHANGED);
fl_end_group();

fl_end_form();

return fdui;
}
/*---------------------------------------*/

Saludos: Jesus

Jesus Revilla de Lucas
L. Electronica - ICMM - CSIC
e-Mail: Jesus@Electron.icmm.csic.es
Tlf: 334 90 00 Ext: 009
Fax: 372 06 23

_________________________________________________
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://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/xforms-archive/