Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zlgopen/awtk-cpp
awtk cpp wrapper
https://github.com/zlgopen/awtk-cpp
awtk cpp
Last synced: 4 days ago
JSON representation
awtk cpp wrapper
- Host: GitHub
- URL: https://github.com/zlgopen/awtk-cpp
- Owner: zlgopen
- License: lgpl-2.1
- Created: 2019-12-20T23:20:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T07:56:32.000Z (22 days ago)
- Last Synced: 2024-10-29T08:32:49.140Z (22 days ago)
- Topics: awtk, cpp
- Language: C++
- Size: 24.7 MB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# awtk-cpp
ZLG 开源 GUI 引擎 [awtk](https://github.com/zlgopen/awtk) 针对 C++ 的绑定。
## 准备
1. 获取 awtk 并编译
```
git clone https://github.com/zlgopen/awtk.git
cd awtk; scons; cd -
```2. 获取 awtk-cpp 并编译
```
git clone https://github.com/zlgopen/awtk-cpp.git
cd awtk-cpp
scons
```* 生成资源
```
python ./scripts/update_res.py all
```> 或者通过 designer 生成资源
* 编译PC版本
```
scons
```* 编译LINUX FB版本
```
scons LINUX_FB=true
```> 完整编译选项请参考[编译选项](https://github.com/zlgopen/awtk-widget-generator/blob/master/docs/build_options.md)
## 运行
```
./bin/demo_basic
```## 更新绑定(由本项目的维护人员完成)
```
./sync.sh
```> 在非 bash 终端(如 Windows 平台的 cmd.exe),需要根据 sync.sh 的内容手工执行相应的命令。
## 代码示例
```cpp
TWidget win = TWindow::CreateDefault();
TWidget ok = TButton::Create(win, 0, 0, 0, 0);ok.SetText("quit");
ok.SetSelfLayoutParams("center", "middle", "50%", "30");ok.On(EVT_CLICK, ClickToQuit, NULL);
```## 文档
[AWTK 脚本绑定原理](https://github.com/zlgopen/awtk/blob/master/docs/script_binding.md)
> 本文以 Linux/MacOS 为例,Windows 可能会微妙差异,请酌情处理。
## C++应用程序框架
请参考:hello目录。
> 感谢staunchheart(QQ:36380047)兄提供C++框架(包括代码生成)的思路和各种建议。