Windows OS

How to Install gtk +3 on Windows

GTK is a multi-platform useful toolkit for creating graphical user interface apps. GTK 3 is used to develop an application using different languages according to the developer or user choices such as JavaScript, Perl, Python, Rust, C, and so on. The developer just needs language binding (map one language to another language library) and get full advantage of the GNOME bindings which ensure API stability and time-based releases.

This blog will provide the simplest solution to install GTK +3 on Windows.

How to Install gtk +3 on Windows?

Gtk3 provides a development environment in which developers can create GUI applications more comfortably and can use language to their choice. To install gtk3, we need to install MSYS2 which provides a Unix-like terminal through which we can easily install gtk3 on Windows. The following steps are carried out to install gtk + 3 on windows:

Step 1: Download MSYS2 Installer

To install gtk3, we need to download and install MSYS2 which provides a “mintty” terminal that allows users to install different packages and software easily through the command line on Windows. The below-mentioned link will lead you to download the MSYS2 installer:

https://www.msys2.org/

Step 2: Install MSYS2

Navigate the “Downloads” (or your default directory for downloads) directory and run the MSYS2 installer to start MSYS2 installation:

The setup window will appear on screen, proceed with the “Next” button:

Continue with default selected directory and hit the “Next” button:

To create suggested “Start Menu shortcuts” click on the “Next” button:

Now, you can see that we have installed MSYS2. Mark the checkbox to run MSYS2 terminal and hit the “Finish” button:

You can see that the MSYS2 terminal is launched successfully:

Step 3: Install gtk3

Utilize the “Pacman” package manager to install gtk3 via the following command:

> pacman -S mingw-w64-x86_64-gtk3

During installation, “Proceed with installation?” permission will be needed to allow using the extra space.

You can see that we have successfully installed gtk3 on Windows:

Bonus-Tip: Install Python Binding

Most users use Python language to develop applications and are more familiar with APIs. You can install Python binding with the gtk3 to use Python in the gtk environment. The following command will install bind python with the gtk3:

> pacman -S mingw-w64-x86_64-python3-gobject

You can see that the Python binding is installed successfully.

That’s all! You have learned to install gtk3 on windows.

Conclusion

To install gtk3 on Windows, you need to install MSYS2 first. MSYS2 provides the command line tool named “mintty” that helps us to install gtk3 using the command. For this purpose, use Pacman package manager and execute the “pacman -S mingw-w64-x86_64-gtk3” command to install gtk3 on Windows. You can add programming language binding according to desire as we have added python binding. This post has demonstrated the method to install gtk3 on windows.

About the author

Rafia Zafar

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.