add main.cpp

Signed-off-by: Zengtudor <zengtudor@outlook.com>
This commit is contained in:
Zengtudor 2024-08-31 14:15:31 +00:00
parent bf31b0877d
commit 0865e294fc
1 changed files with 27 additions and 0 deletions

27
src/main.cpp Normal file
View File

@ -0,0 +1,27 @@
#include<FL/Fl.H>
#include<FL/Fl_Window.H>
#include<FL/Fl_Box.H>
#include<FL/Fl_Button.H>
#include<FL/fl_ask.H>
#include<bits/stdc++.h>
using namespace std;
int main(int argc,char *argv[]){
auto window = make_unique<Fl_Window>(500,300);
auto box = make_unique<Fl_Box>(20,40,260,100,"Hello world");
box->box(FL_UP_BOX);
box->labelsize(20);
box->labelfont(FL_BOLD+FL_ITALIC);
box->labeltype(FL_SHADOW_LABEL);
auto btn = make_unique<Fl_Button>(20,200,100,50,"btn");
btn->callback((Fl_Callback*)[](Fl_Widget *w,void *v)->void{
fl_alert("btn callback");
});
window->end();
window->show(argc,argv);
return Fl::run();
}