Une collection de notes diverses sur des trucs et astuces pour faire des choses avec un ordinateur...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
TetaTricks/code/xf_yesno.c

33 lines
843 B

#include <forms.h>
int main(int argc, char *argv[]) {
FL_FORM *form;
FL_OBJECT *yes,
*no,
*but;
fl_initialize(&argc, argv, "FormDemo", 0, 0);
form = fl_bgn_form(FL_UP_BOX, 320, 120);
fl_add_box(FL_BORDER_BOX, 160, 40, 0, 0, \
"Do you want to Quit?");
yes = fl_add_button(FL_NORMAL_BUTTON, \
40, 70, 80, 30, "Yes");
no = fl_add_button(FL_NORMAL_BUTTON, \
200, 70, 80, 30, "No");
fl_end_form();
fl_show_form(form, FL_PLACE_MOUSE, FL_TRANSIENT, \
"Question");
while (1) {
if (fl_do_forms() == yes {
printf("Yes is pushed\n");
break;
}
else printf("No is pushed\n");
}
fl_finish();
return 0;
}