This method is based on the packages provided by MSYS2, which provides a UNIX-like environment for Windows. Both of these repositories also provide packages for a large number of other useful open source libraries.
The MSYS2 project provides a UNIX-like development environment for Windows. It provides packages for many software applications and libraries, including the GTK stack. If you prefer developing using Visual Studio, you should use gvsbuild instead.
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.
For anyone who comes across this post and is trying to customize on a non desktop environment setup, Check out lxappearance which can be found on any standard package managers. It's super lightweight and it lets you setup any GTK theme you like without having to install a desktop environment. cheers
GTK inspects a number of environment variables in addition tostandard variables like LANG, PATH, HOME or DISPLAY; mostlyto determine paths to look for certain files. The X11,Wayland, Windows andBroadway GDK backends use some additionalenvironment variables.
Note that this environment variable is read by GTK 2.x and GTK 3.xtoo, which makes it unsuitable for setting it system-wide (orsession-wide), since doing so will cause applications usingdifferent GTK versions to see incompatible modules.
Specifies the file listing the GdkPixbuf loader modules to load.This environment variable overrides the default valuelibdir/gtk-4.0/4.0.0/loaders.cache (libdir is the sysconfdirspecified when GTK was configured, usually /usr/lib.)
This environment variable can contain a comma-separated list ofbackend names, which are tried in order. The list may also containa *, which means: try all remaining backends. The special valuehelp can be used to make GDK print out a list of all availablebackends. For more information about selecting backends,see the gdk_display_manager_get() function.
The default value of this environment variable is 1. If changedto 0, this disables the default use of client-side decorationson GTK windows, thus making the window manager responsible fordrawing the decorations of windows that do not have a customtitlebar widget.
GTK uses this environment variable to provide startup notificationaccording to the Startup Notification Spec.Following the specification, GTK unsets this variable after readingit (to keep it from leaking to child processes). So, if you need itsvalue for your own purposes, you have to read it before callinggtk_init().
GTK includes an interactive debugger, called the GTK Inspector, whichlets you explore the widget tree of any GTK application at runtime,as well as tweak the theme and trigger visual debugging aids. You caneasily try out changes at runtime before putting them into the code.
There are a few more environment variables that can be set to influencehow the inspector renders its UI. GTK_INSPECTOR_DISPLAY andGTK_INSPECTOR_RENDERER determine the GDK display and the GSKrenderer that the inspector is using.
Since GTK 3.15, overlay scrollbars are enabled by default, meaning that scrollbars will be shown only on mouseover in GTK 3 applications. This behavior can be reverted by setting the following environment variable: GTK_OVERLAY_SCROLLING=0. See Environment variables#Graphical environment.
The positions of the overlay scrollbars are indicated by thin dashed lines in the application window. These dashed lines will be present even when overlay scrolling is disabled using the environment variable discussed in the section above. To remove the indicator lines, create the following file:
An example of such variables are gtk-color-scheme and icon-theme, which must have their keys set with GSettings in order to theme GTK Applications under Wayland. Alternatively, if only the theme needs to be customized, the environment variable GTK_THEME can be set.
For some applications in GNOME's Wayland session. Your /.config/gtk-3.0/settings.ini file is misconfigured. This can happen if you try other GTK based desktop environments. These are the offending values:
Using dnf, I have known that gtk4 is installed with Fedora since last fall. I installed the gtk4-devel today, so both are installed, according to the package manager. I have spent a year looking for a way to make desktop shortcuts and for some applications I can do it, but how to make a desktop shortcut for GTK has not been found by me. I heavily searched GTK, Fedora, and other websites, as well as video tutorials, yet I keep looking hard. While developing a tutorial or written instructions, teams routinely forget that beginners want GTK and need added information, being that GTK and Fedora are outside the mainstream in a few ways.
Another issue is that I want to use Code::Blocks to help with GTK and C learning. Code Blocks must be tied to the environment container around GTK, so they will integrate. Michael B. has a fine set of tutorials on YT on all of these issues, but it is Mint based and does not work for Fedora because some of the libraries are the same yet have a different naming convention for Mint. I set up the environment with Nano, Meson, and Ninja. All my dependency libraries are installed, according to dnf. At some point, the build process breaks because the set environment does not find already installed library dependencies, though MOST of them it does.
At least I am learning much and slowly progressing.
I might need to install Mint so I can use the tutorials of Michael B. Yikes. Spending hundreds more hours in researching and working to have a running GTK on my desktop is NOT an option.
Thank you, for the help, Stephen, but perhaps running GTK on Fedora is esoteric enough to block this beginner. NO REGRETS! I learned much which I would not have learned otherwise at this stage of my growth.
Thank you
Do you perhaps have Pantheon, Budgie, Cinnamon, GNOME or Deepin also enabled? Those already install xdg-desktop-portal-gtk overridden to not contain some portals provided by those respective desktop environments.
We added support for artificially limiting the texture size (with the GSK_MAX_TEXTURE_SIZE environment variable), and promptly discovered that our texture slicing support needed some love. It will work much better in 4.12.
One thing you could try: add that override to your system's /etc/environment file (note: edit as root). Afaik, overrides such as these s/b established before your desktop-environment starts up as they seem to affect any apps started later via your DE, or even the DE itself as it starts up. Worth a try?
Sorry to hear that. When you added your new line to the /etc/environment file, you did leave the "export" command off, right? I am asking this because if there is a syntax error, none of the file's variables get initialized/set. Typically, programs suddenly "stop working" when their PATH variables got messed up...
At about the same time that the GTK was being updated to the GTK+, shockwaves hit the community: In 1996, Martin Gräßlin announced that he was working on an attractive desktop environment for UNIX-like systems. His message was generally greeted with applause. However, devoted free software advocates disagreed with his choice to use the then-proprietary Qt toolkit as a base for his project. Sensing that the KDE could have inadvertently led to a licensing nightmare on otherwise open-source UNIX-like operating systems, a few months later the GNU project announced that it would begin development of a competing desktop environment known as GNOME. GNOME would be based on GTK+ and would thus be fully open source.
Add the environment variable either systemwide at /etc/environment or user specific into a /.config/environment.d/envvars.conf file or /.profile depending on the used Desktop or WM setup it could be zthe one or the other needs to be used.
Both applications are required because kvantum does not allow the font settings. Therefore qt5ct is also set as an environment variable, as it works in most desktop environments or when using a window manager as a user. In some cases, e.g. when using Cinnamon, it is necessary to set the variable system-wide, because Cinnamon seems to ignore variables that are set as users. Then we set qt5ct to use the kvantum theme and set fonts inside qt5ct.
I originally used an virtual environment to try to stop something like this from happening but I must have used the environment incorrectly. Besides, I coded it with Python 3.6 and VSCode now only supports 3.7+.
The 32 bit Windows installer is gtk2-runtime-2.24.10-2012-10-10-ash.exe and can be obtained from -win.sourceforge.net/home/index.php/Main/Downloads. It installs to C:\Program Files (x86)\GTK2-Runtime with the DLLs in \bin and the installer adds this location to your PATH
If running 64 bit Python install using gtk2-runtime-2.24.30-2016-04-09-ts-win64.exe from -for-Windows-Runtime-Environment-Installer which installs to C:\Program Files\GTK2-Runtime Win64 with the DLLs in \bin. This installer also adds this location to your PATH.
If you need to work with both 32 and 64 bit versions as I do, in different virtualenvs, you can take advantage of the fact that the \Scripts directory of the currently active environment is automatically pre-pended to the PATH so the corresponding DLLs can be copied there.
GTK inspects a number of environment variables in addition to standard variables like LANG, PATH, HOME or DISPLAY; mostly to determine paths to look for certain files. The X11, Wayland, Windows and Broadway GDK backends use some additional environment variables.
Note that this environment variable is read by GTK 2.x and GTK 3.x too, which makes it unsuitable for setting it system-wide (or session-wide), since doing so will cause applications using different GTK versions to see incompatible modules.
Specifies the file listing the GdkPixbuf loader modules to load. This environment variable overrides the default value libdir/gtk-4.0/4.0.0/loaders.cache (libdir is the sysconfdir specified when GTK was configured, usually /usr/lib.)
760c119bf3