2019-10-23 13:32:13 +02:00
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Window.H>
|
|
|
|
#include <FL/Fl_Button.H>
|
|
|
|
#include <iostream>
|
2019-10-16 16:52:36 +02:00
|
|
|
|
2019-10-23 13:32:13 +02:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
void button_cb(Fl_Widget* wid){
|
|
|
|
Fl_Button* but = (Fl_Button*)wid;
|
|
|
|
|
|
|
|
if(but->label()=="&Good job"){
|
|
|
|
but->label("&Click me");
|
|
|
|
} else
|
|
|
|
but->label("&Good job");
|
|
|
|
but->redraw();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
Fl_Window win(300,200,"Testing");
|
|
|
|
int i = 7;
|
|
|
|
win.begin();
|
|
|
|
Fl_Button but(20,150,70,30,"&Click me");
|
|
|
|
win.end();
|
|
|
|
but.callback(button_cb);
|
|
|
|
win.show();
|
|
|
|
return Fl::run();
|
2019-10-16 16:52:36 +02:00
|
|
|
}
|