我可以从 ocaml 顶层构建图形界面吗?
À 有关交互式顶层和图形 UI 编程的几个问题:
是否可以从 ocaml 顶层动态构建图形界面?
也可以使用图形库吗?
À few questions regarding the interactive toplevel and graphical UI programming:
Is it possible to build a graphical interface dynamically from ocaml toplevel?
It is possible to use the Graphics library too?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在基于 debian 的系统上安装 lwt-glib 和 lablgtk:
apt-get install liblwt-glib-ocaml-dev liblablgtk2-ocaml-dev
在 OCaml 顶层中,加载所有内容:
然后初始化 GTK 和 LWT 集成:
并播放:
install lwt-glib and lablgtk, on debian based systems:
apt-get install liblwt-glib-ocaml-dev liblablgtk2-ocaml-dev
in the OCaml toplevel, load everything:
then initialise the GTK and the LWT integration:
And play:
您还可以使用
Graphics
模块(请参阅手册)。您需要自己管理很多事情(事件循环、工具包),但它比 Lablgtk 简单得多:You can also use the
Graphics
module (see the manual). You will need to manage a lot of things yourself (the event loop, the toolkits) but it is much simpler thanlablgtk
: