7 #include <FL/Fl_Double_Window.H>
8 #include <FL/Fl_Input.H>
9 #include <FL/Fl_Button.H>
10 #include <FL/Fl_Return_Button.H>
11 #include <FL/fl_ask.H>
14 static void update_input_text(Fl_Widget
* o
, const char *input
) {
22 static void rename_me(Fl_Widget
*o
) {
23 const char *input
= fl_input("Input:", o
->label());
24 update_input_text(o
, input
);
28 static void rename_me_pwd(Fl_Widget
*o
) {
29 const char *input
= fl_password("Input PWD:", o
->label());
30 update_input_text(o
, input
);
34 static void window_callback (Fl_Widget
*w
, void *) {
35 int rep
= fl_choice("Are you sure you want to quit?", "Cancel", "Quit", "Dunno");
37 ((Fl_Double_Window
*)w
)->hide();
40 if (rep
== 2) fl_message("Well, maybe you should know before we quit.");
44 static void fltkDo (void) {
45 char buffer
[128] = "Test text";
46 char buffer2
[128] = "MyPassword";
48 Fl_Double_Window
*w
= new Fl_Double_Window(200, 105);
50 Fl_Return_Button
*b
= new Fl_Return_Button(20, 10, 160, 35, buffer
); b
->callback(rename_me
);
51 Fl_Button
*b2
= new Fl_Return_Button(20, 50, 160, 35, buffer2
); b2
->callback(rename_me_pwd
);
55 w
->callback(window_callback
);
64 printf("fltkDo: complete\n");
70 static void *fltkWorkerThread (void *dummy
) {
76 static void runFLTKThread (void) {
78 if (pthread_create(&trd
, NULL
, fltkWorkerThread
, NULL
) == 0) {
84 LST_PRIMFN_NONSTATIC(lpFLTKAction
) {