CINXE.COM

The GTK Project - A free and open-source cross-platform widget toolkit

<!DOCTYPE html><html lang="en"dir="ltr"><head><meta charset="UTF-8"><meta name="viewport"content="width=device-width,height=device-height,initial-scale=1,minimum-scale=1,shrink-to-fit=no"><meta http-equiv="X-UA-Compatible"content="ie=edge"><meta name="theme-color"content="#ffffff"><meta name="apple-mobile-web-app-status-bar-style"content="#ffffff"><meta name="generator"content="Jekyll v4.0.1"><meta name="author"content="The GTK Team"><meta name="keywords"content="gtk, gtk, gimp, gnome, toolkit, user interface"><title>The GTK Project - A free and open-source cross-platform widget toolkit</title><meta itemprop="description"name="description"content="GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces."><meta property="og:locale"content="en_US"><meta property="og:type"content="article"><meta property="og:title"content="The GTK Project - A free and open-source cross-platform widget toolkit"><meta property="og:url"content="https://www.gtk.org/docs/language-bindings/index"><meta property="og:image"content="/assets/img/logo-gtk.png"><meta property="og:site_name"content="The GTK Team"><meta property="og:description"content="GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces."><meta property="twitter:title"content="The GTK Project - A free and open-source cross-platform widget toolkit"><meta property="twitter:description"content="GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces."><meta name="twitter:site"content="@"><meta name="twitter:creator"content="@"><meta name="twitter:card"content="summary"><link rel="apple-touch-icon"sizes="180x180"href="https://www.gtk.org/assets/img/icons/apple-touch-icon.png"><link rel="icon"type="image/png"sizes="32x32"href="https://www.gtk.org/assets/img/icons/favicon-32x32.png"><link rel="icon"type="image/png"sizes="16x16"href="https://www.gtk.org/assets/img/icons/favicon-16x16.png"><link rel="canonical"href="https://www.gtk.org/docs/language-bindings/index"><link rel="stylesheet"href="https://www.gtk.org/assets/@fortawesome/fontawesome-free/css/all.min.css"type="text/css"media="screen"><link rel="stylesheet"href="https://www.gtk.org/assets/css/markdown.css"type="text/css"media="screen"><link rel="stylesheet"href="https://www.gtk.org/assets/css/theme.css"type="text/css"media="screen"><link rel="stylesheet"href="https://www.gtk.org/assets/css/colorful.css"type="text/css"media="screen"><link rel="stylesheet"href="https://www.gtk.org/assets/css/index.css"type="text/css"media="screen"></head><body><header class="navbar small bg-dark"><nav class="container navbar-expand-md px-0 px-md-3"><a href="https://www.gtk.org"class="navbar-brand text-white"><img src="https://www.gtk.org/assets/img/logo-gtk-sm.png"class="pr-2"style="max-width:40px;"><strong>GTK</strong></a> <a class="btn navbar-toggler border-0 bg-white"role="button"data-toggle="collapse"data-target="#navbarSupportedContent"href="#"><i class="fas fa-ellipsis-h text-dark"></i></a><div class="collapse navbar-collapse"id="navbarSupportedContent"><ul class="navbar-nav ml-auto"><a href="https://www.gtk.org/features/"class="nav-link-dark float-right text-white rounded">Features</a> <a href="https://www.gtk.org/docs/"class="nav-link-dark float-right text-white rounded">Docs</a> <a href="https://www.gtk.org/community/"class="nav-link-dark float-right text-white rounded">Community</a> <a href="https://gitlab.gnome.org/GNOME/gtk/"target="_blank"class="nav-link-dark float-right text-white rounded">Code</a> <a href="https://blog.gtk.org/"target="_blank"class="nav-link-dark float-right text-white rounded">Development Blog</a></ul></div></nav></header><button class="d-none btn border border-info bg-white rounded-circle position-fixed"id="btn-go-to-top"><i class="fas fa-angle-up"></i></button><section><div class="container"><div class="row"><div class="col-md-3 small p-0 nav-side"id="mySidenav"><div class="text-break bg-white p-0 pt-2 pt-md-4 h-100"><a href="#"class="btn d-md-none btn-close mt-2"onclick="closeSideNav()"><i class="fas fa-times fa-halfx"></i></a><ul class="list-group"><li class="list-group-item border-0 group-header pb-4"><a href="https://www.gtk.org/docs/getting-started/"class="text-dark"><i class="fas fa-cogs fa-fw"></i> <strong>Getting Started</strong></a><ul class="list-group"><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/getting-started/hello-world/"class="text-muted stretched-link">Hello World</a></li></ul></li><li class="list-group-item border-0 group-header pb-4"><a href="https://www.gtk.org/docs/installations/"class="text-dark"><i class="fas fa-box-open fa-fw"></i> <strong>Installations</strong></a><ul class="list-group"><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/installations/linux/"class="text-muted stretched-link">Linux</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/installations/macos/"class="text-muted stretched-link">Macos</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/installations/windows/"class="text-muted stretched-link">Windows</a></li></ul></li><li class="list-group-item border-0 group-header pb-4"><a href="https://www.gtk.org/docs/language-bindings/"class="text-dark"><i class="fas fa-random fa-fw"></i> <strong>Language Bindings</strong></a><ul class="list-group"><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/language-bindings/cpp/"class="text-muted stretched-link">Cpp</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/language-bindings/guile/"class="text-muted stretched-link">Guile</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/language-bindings/javascript/"class="text-muted stretched-link">Javascript</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/language-bindings/python/"class="text-muted stretched-link">Python</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/language-bindings/rust/"class="text-muted stretched-link">Rust</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/language-bindings/vala//"class="text-muted stretched-link">Vala</a></li></ul></li><li class="list-group-item border-0 group-header pb-4"><a href="https://www.gtk.org/docs/dev-tools/"class="text-dark"><i class="fas fa-tools fa-fw"></i> <strong>Dev Tools</strong></a><ul class="list-group"><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/dev-tools/eclipse/"class="text-muted stretched-link">Eclipse</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/dev-tools/gnome-builder/"class="text-muted stretched-link">Gnome Builder</a></li></ul></li><li class="list-group-item border-0 group-header pb-4"><a href="https://www.gtk.org/docs/apis/"class="text-dark"><i class="fas fa-cubes fa-fw"></i> <strong>API References</strong></a><ul class="list-group"><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://docs.gtk.org/gtk4/"class="text-muted stretched-link">GTK</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://docs.gtk.org/gdk4/"class="text-muted stretched-link">GDK</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://docs.gtk.org/gsk4/"class="text-muted stretched-link">GSK</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://docs.gtk.org/gdk-pixbuf/"class="text-muted stretched-link">GdkPixbuf</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://docs.gtk.org/Pango/"class="text-muted stretched-link">Pango</a></li></ul></li><li class="list-group-item border-0 group-header pb-4"><a href="https://www.gtk.org/docs/architecture/"class="text-dark"><i class="fas fa-vector-square fa-fw"></i> <strong>Architecture</strong></a><ul class="list-group"><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/architecture/glib/"class="text-muted stretched-link">Glib</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.gtk.org/docs/architecture/pango/"class="text-muted stretched-link">Pango</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.cairographics.org/documentation/"class="text-muted stretched-link">Cairo</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.opengl.org/"class="text-muted stretched-link">OpenGL</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://www.vulkan.org/"class="text-muted stretched-link">Vulkan</a></li><li class="list-group-item border-0 p-0 py-1 padding-icon"><a href="https://wayland.freedesktop.org/"class="text-muted stretched-link">Wayland</a></li></ul></li></ul></div></div><div class="col-md-9 py-4 px-sm-4 bg-light border-0 border-md-left"><div class="d-flex flex-sm-row flex-column py-3 py-md-0 app-shadow"><div class="w-100"><button class="btn btn-mdcolor btn-sm d-inline-block d-md-none"onclick="openSideNav()"role="button"><i class="fas fa-bars fa-fw pr-2"></i>More Topics</button><nav aria-label="breadcrumb"><ol class="breadcrumb small bg-transparent pl-0 m-0"><li class="breadcrumb-item"><a href="https://www.gtk.org/docs/">Docs</a></li><li class="breadcrumb-item active"aria-current="page">Language Bindings</li></ol></nav></div></div><article class="markdown-body my-4"><h1 id="language-bindings">Language Bindings</h1><p>GTK is written using the <a href="https://en.m.wikipedia.org/wiki/C_(programming_language)">C programming language</a>, but its also available to various programming languages through <em>language bindings</em>, which allow writing GTK applications in the style of those languages. Language bindings are relatively easy to create because GTK is designed with them in mind.</p><p>There are various, maintained language bindings available for GTK:</p><table><thead><tr><th>Language</th><th style="text-align: center">v3</th><th style="text-align: center">v4</th></tr></thead><tbody><tr><td><a href="https://www.gtkmm.org/en/index.html">C++</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://gtkd.org/">D</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://github.com/diamondburned/gotk4">Go</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://www.gnu.org/software/g-golf/">Guile</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md">JavaScript</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="http://gtk2-perl.sourceforge.net/">Perl</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://pygobject.readthedocs.io/en/latest/">Python</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://gtk-rs.org">Rust</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr><tr><td><a href="https://valadoc.org/">Vala</a></td><td style="text-align: center"><i class="far fa-check-circle"></i></td><td style="text-align: center"><i class="far fa-check-circle"></i></td></tr></tbody></table><h2 id="introspection">Introspection</h2><p>GTK generates a complete, machine readable description of its API as part of its build; the introspection data is available both as an XML file and as a binary format that can be loaded using a shared library. The introspection data is commonly used to write the language bindings in the list above.</p><p>For more information on the introspection data, you can read <a href="https://gi.readthedocs.io/en/latest/">the GObject Introspection documentation</a>.</p></article><div class="bg-white p-3 border rounded shadow-sm small"><i class="fas fa-edit text-info fa-fw pr-2"></i> <span>Observed a typo or some missing information, <a href="https://gitlab.gnome.org/Teams/Websites/www.gtk.org/tree/master/_docs/language-bindings/index.md">edit this page</a>.</span><br><i class="fas fa-plus-square text-info fa-fw pr-2"></i> <span>Read on <a href="https://gitlab.gnome.org/Teams/Websites/www.gtk.org/tree/master/CONTRIBUTING.md/">how to contribute</a> to this website.</span></div></div></div></div></section><script src="https://www.gtk.org/assets/jquery/dist/jquery.min.js"></script><script src="https://www.gtk.org/assets/popper.js/dist/umd/popper.min.js"></script><script src="https://www.gtk.org/assets/bootstrap/dist/js/bootstrap.min.js"></script><script>var btnTop = $("#btn-go-to-top"); $(window).scroll(function() { if ($(window).scrollTop() < 400) { btnTop.addClass("d-none"); } else { btnTop.removeClass("d-none"); } }); btnTop.on("click", function(e) { e.preventDefault(); $("html, body").animate({scrollTop: 0}); });</script><script>// handles the sidebar opening and closing functionality function openSideNav() { document.querySelector(".nav-side").style.left = "0%"; document.querySelector(".nav-side").style.opacity = "1"; } function closeSideNav() { document.querySelector(".nav-side").style.left = "-100%"; document.querySelector(".nav-side").style.opacity = "0"; } // adds anchor links to the headings in the markdown body var headings = document.querySelectorAll( '.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6' ); headings.forEach(heading => { heading.innerHTML = heading.innerHTML + ` <a id="${heading.id}" href="#${heading.id}" class="anchor"><i class="fas fa-link octicon octicon-link text-secondary" style="font-size: 0.8rem;"></i></a> `; });</script><footer class="container-fluid bg-dark navbar-dark text-info py-4 small"><div class="container"><div class="row"><div class="col-sm-5 col-lg-4 py-3 py-sm-2"><a href="https://www.gnome.org/"><img src="https://www.gtk.org/assets/img/logo-gnome-horizontal.svg"class="img-fluid pb-2"width="100"></a><p>GTK is hosted by GNOME.</p><p>GTK is maintained by the <a href="https://www.gtk.org/community#contributors"class="text-muted font-weight-bold">GTK Team</a>.</p><p>&copy; 1997-2024, The GTK Team. All Rights Reserved.</p><p>GTK and the GTK logo are <a href="https://foundation.gnome.org/legal-and-trademarks/"class="text-muted font-weight-bold">trademarks of the GNOME Foundation</a>.</p></div><div class="col-sm-7 col-lg-5 py-3 py-sm-2"><div class="d-flex"><div class="col pl-0"><h6 class="text-muted">PROJECT</h6><ul class="list-unstyled text-small"><li><a href="https://www.gtk.org/"class="text-info">GTK</a></li><li><a href="https://www.gtk.org/features/"class="text-info">Features</a></li><li><a href="https://www.gtk.org/docs/"class="text-info">Docs</a></li><li><a href="https://download.gnome.org/sources/gtk/"class="text-info">Downloads</a></li><li><a href="https://gitlab.gnome.org/GNOME/gtk/tree/master/COPYING"class="text-info">License</a></li><li><a href="https://gitlab.gnome.org/GNOME/gtk/-/releases"class="text-info">Releases</a></li><li><a href="https://gitlab.gnome.org/GNOME/gtk/"class="text-info">Code</a></li></ul></div><div class="col pl-0"><h6 class="text-muted">SUPPORT</h6><ul class="list-unstyled text-small"><li><a href="https://docs.gtk.org/gtk4/question_index.html"class="text-info">FAQs</a></li><li><a href="https://gitlab.gnome.org/GNOME/gtk/issues/new"class="text-info">Report a Bug</a></li><li><a href="https://gitlab.gnome.org/GNOME/gtk/issues/new"class="text-info">Request a feature</a></li></ul></div><div class="col pl-0"><h6 class="text-muted">COMMUNITY</h6><ul class="list-unstyled text-small"><li><a href="https://www.gtk.org/community/"class="text-info">Community</a></li><li><a href="https://blog.gtk.org/"class="text-info">Development Blog</a></li><li><a href="https://discourse.gnome.org"class="text-info">Discussion</a></li><li><a href="https://conduct.gnome.org"class="text-info">Code of Conduct</a></li><li><a href="http://www.gnome.org/foundation/"class="text-info">Donate</a></li></ul></div></div></div><div class="col-sm-12 col-lg-3 py-3 py-sm-2"><h5>About the Site</h5><ul class="list-unstyled text-small"><li>Hosted on <a href="https://gitlab.gnome.org/Teams/Websites/www.gtk.org"class="text-muted font-weight-bold">Gitlab</a>.</li><li>Powered by <a href="https://jekyllrb.com/"class="text-muted font-weight-bold">Jekyll</a>.</li><li>Report <a href="https://gitlab.gnome.org/Teams/Websites/www.gtk.org/-/issues/new"class="text-muted font-weight-bold">an issue</a>.</li></ul><ul class="list-unstyled list-inline text-small"><li class="list-inline-item"><a href="https://gitlab.gnome.org/GNOME/gtk/"rel="me"class="text-muted text-primary"><i class="fab fa-gitlab"></i></a></li><li class="list-inline-item"><a href="https://discourse.gnome.org/c/platform/core/"rel="me"class="text-muted text-primary"><i class="fab fa-discourse"></i></a></li><li class="list-inline-item"><a href="https://floss.social/@GTK"rel="me"class="text-muted text-primary"><i class="fab fa-mastodon"></i></a></li></ul></div></div></div></footer></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10