GUI/main/main.cpp

28 lines
536 B
C++

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <iostream>
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();
}