I am using Visual Studio 2019 on Windows 10 and am trying to use GTK in C++ and installed it using vcpkg.
I've installed GTK using vcpkg
according to the guide from GTK. I'm using Visual Studio 2019 and it is able to compile and run the example program here, but there is an issue regarding the theme and icons. According to the installation guide, under the section Building and distributing your application there are some things that must be done to get themes and icons to work.
I've started by downloading the Windows theme the guide suggests and have it in a share
directory and then I've created a settings.ini
file in an etc
directory. It says to place this in the "install directory", which I assume is where Visual Studio is placing the exe for the program. I've tried it in both build and release, in the source files, in the top project directory - all with no success (and I did make sure it is targeting x64).
Just in case I also tried placing these where vcpkg is installed as well as where vcpkg installs gtk. No luck. When the program runs I get the warning
(gtkExample0.exe:16772): Gtk-WARNING **: Could not find the icon 'window-minimize-symbolic-ltr'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases
So it seems that it is never finding the ssettings.ini
file telling it to use the Windows 10 theme. Has anyone had any luck with getting this to work (both from VS2019 debugging runs and in deployment)?
To summarize the files:
share\themes\Windows10\gtk-3.0\gtk-3.20\
(downloaded from suggested GitHub repo)
etc\settings.ini
contains:
[Settings]
gtk-theme-name=Windows10
gtk-font-name=Segoe UI 9
I've placed these in
<VS2019Project>\x64\Release
,
<VS2019Project>\x64\Debug
,
C:<path_to_vcpkg>\vcpkg\packages\gtk_x64-windows
,
C:<path_to_vcpkg>\vcpkg\installed\x64-windows
All with no change when running from VS2019 under Release or Debug.