Steward
分享是一種喜悅、更是一種幸福
程式語言 - The Fast Light Tool Kit (FLTK) - CPP - Button
參考資訊:
https://www.fltk.org/doc-1.3/index.html
Button種類

main.cpp
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/fl_ask.H>
void on_click(Fl_Widget* widget, void* data) {
fl_message("Clicked !");
}
int main() {
const int w = 320;
const int h = 240;
Fl_Window window(w, h, "main");
Fl_Button button(100, 100, 120, 40, "Click Me");
button.callback(on_click);
window.end();
window.show();
return Fl::run();
}
編譯、執行
$ g++ main.cpp -o main -lfltk $ ./main
