- 生成 24 个 _cfl*.vp(10327 条 extern 声明)+ _types/_enums 常量 - __init__.vp 提供 Fl/Fl_Widget/Fl_Window/Fl_Button/Fl_Input/Fl_Text_Buffer/Fl_Group/Fl_Menu_Bar/Fl_Native_File_Chooser 等包装类 - 回调(Fl_Callback)按 bytes 不透明处理,菜单回调位传 t.CPtr(0) - 新增 examples/hello.vp、dialog.vp 冒烟样例,26 个 .vp 全部通过 vast parse - 内嵌 cfltk(C API 封装)与 FLTK 1.4 完整源码,构建目标 cfltk2
22 lines
649 B
C
22 lines
649 B
C
#include <cfltk2/cfl.h> // Fl_init_all, Fl_lock, Fl_run
|
|
#include <cfltk2/cfl_box.h>
|
|
#include <cfltk2/cfl_enums.h>
|
|
#include <cfltk2/cfl_image.h> // Fl_register_images
|
|
#include <cfltk2/cfl_window.h>
|
|
|
|
#define TRUE 1
|
|
#define FALSE 0
|
|
#define NULL (void *)0
|
|
|
|
int main(void) {
|
|
Fl_register_images();
|
|
Fl_Window *w = Fl_Window_new(100, 100, 400, 300, NULL);
|
|
Fl_Box *b = Fl_Box_new(0, 0, 400, 300, NULL);
|
|
Fl_Window_end(w);
|
|
Fl_Window_show(w);
|
|
Fl_Window_set_color(w, Fl_Color_White);
|
|
Fl_PNG_Image *i = Fl_PNG_Image_new("img.png");
|
|
Fl_PNG_Image_scale(i, 400, 300, TRUE, FALSE);
|
|
Fl_Box_set_image(b, i);
|
|
return Fl_run();
|
|
} |