WINDOWS下安装GTK4开发环境

Step 1.: 下载 MSYS2 installer WIN32或 WIN64版本。

Step 2.:运行 MSYS2输入:

pacman -S mingw-w64-ucrt-x86_64-gtk4

如果要安装 GTK3 输入:

pacman -S mingw-w64-ucrt-x86_64-gtk3

Step 3. 安装GTK4程序在WINDOWS下的C/C++编译环境MINGW-W64,输入:

pacman -S mingw-w64-ucrt-x86_64-toolchain base-devel

安装GTK4程序在WINDOWS下的PYTHON开发环境,输入:

pacman -S mingw-w64-ucrt-x86_64-python-gobject

安装WIN10主题:

Once you have installed the GTK as above, you should have little problem compiling a GTK app. In order to run it successfully, you will also need a GTK theme. There is some old builtin support for a Windows theme in GTK, but that makes your app look like a Windows 7 app. It is better to get a Windows 10 theme, for instance the Windows 10 Transformation Pack.

Step 1. 从 Windows 10 Transformation Pack repository 复制图标到本地 share/themes/Windows10:

  • for the GTK4 assets, copy the contents of the gtk-4.0 folder under share/themes/Windows10/gtk-4.0
  • for the GTK3 assets, copy the contents of the gtk-3.20 folder under share/themes/WIndows10/gtk-3.0

Step 2. You also need to copy the icons from the Adwaita theme, which you can download from the GNOME sources.

Step 3. Perform the same steps for the hicolor icons, which are the mandatory fallback for icons not available in Adwaita.

Step 4. 在 etc 文件夹下创建settings.ini:

  • for GTK4, use etc/gtk-4.0/settings.ini
  • for GTK3, use etc/gtk-3.0/settings.ini

settings.ini 中输入:

[Settings]
gtk-theme-name=Windows10
gtk-font-name=Segoe UI 9

Step 5. 运行glib-compile-schemas 安装主题:

glib-compile-schemas share/glib-2.0/schemas

Step 6. You can then zip up your installation folder, or use an installer generator to do that for you, and distribute the result.

You may use MSYS2 to build your GTK application and create an installer to distribute it. Your installer will need to ship your application build artifacts as well as GTK binaries and runtime dependencies.

You are welcome to redistribute GTK binaries, including applications that bundle them, on other web sites, CD-ROM, and other media. You don’t have to ask for permission. That’s one of the points of Free Software.

One important thing that the GNU licenses require is that you must also redistribute the source code on request. This usually means at least the gettext, GLib, GTK, Pango and ATK sources.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值