Files
TransPyC/includes/fltk/examples/hello._vp
T
TermiNexus 6892183cc9 feat(fltk): 新增 FLTK 1.4 纯 extern FFI 绑定库(对接 cfltk C API)
- 生成 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
2026-09-01 19:53:54 +08:00

22 lines
625 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# hello.vp — fltk 冒烟测试:窗口 + 文本 + 按钮(事件循环)
#
# 构建产物需链接 cfltk2(FLTK 1.4 C API 封装)。Viper 端暂不能传函数
# 指针回调,按钮回调请走 C 层钩子或轮询 Fl.event*;本示例演示基础布局。
import t
import fltk
def hello_main() -> int:
fltk.Fl_init_all()
fltk.Fl_register_images()
win = fltk.Fl_Window(400, 300, "Hello")
box = fltk.Fl_Box(100, 60, 200, 40, "Hello, World!")
btn = fltk.Fl_Button(150, 150, 100, 30, "Click me")
win.end()
win.show()
# 阻塞直到所有窗口关闭
fltk.Fl.run()
return 0