I know only 2 way to do this: gs and wx. gs is a bit simpler but the first line of the documentation is a warning telling that gs is not recommended for new application, use wx instead :o) wx isn't so complex, but its documentation is really poor, and simply refers to wxWidget one. at least there are some demo (demo, sudoku, xrc...) that helps to start to build something. And once you succeed to have your first panels and sizers working, it is really simple to get the key stroke or mouse events an react on them. My main difficulty was in displaying graphical things fast and smooth enough even if at the end it is only a few lines of code (a few 10s). finally, the erlang console is meant to evaluate erlang expression, so there is no chance that you can capture simple event and control the display in that environment (at a reasonable effort at least).
2条答案
按热度按时间iaqfqrcu1#
I know only 2 way to do this: gs and wx.
gs is a bit simpler but the first line of the documentation is a warning telling that gs is not recommended for new application, use wx instead :o)
wx isn't so complex, but its documentation is really poor, and simply refers to wxWidget one. at least there are some demo (demo, sudoku, xrc...) that helps to start to build something. And once you succeed to have your first panels and sizers working, it is really simple to get the key stroke or mouse events an react on them. My main difficulty was in displaying graphical things fast and smooth enough even if at the end it is only a few lines of code (a few 10s).
finally, the erlang console is meant to evaluate erlang expression, so there is no chance that you can capture simple event and control the display in that environment (at a reasonable effort at least).
56lgkhnf2#
您可以尝试学习
kernel
的模块group
和user_drv
,但它们都有未公开的接口,并且可能在任何未来的Erlang/OPT版本中发生变化。您也可以制作自己的驱动程序或NIF来处理termios
设置,并制作自己的实现。顺便说一句,我肯定会坚持使用
wx
。