Gtk4 Tutorial

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • gladis

    [Deprecated] Easily import Glade-generated UI files into Rust code.

  • Gtk-rs is still pretty bare bone.

    I tried to do my part by removing boilerplate using macros [1] [2], but it is still complicated to design GTK apps. Even since now, because Glade has been deprecated for GTK4 and no visual editor is available to replace it for now, making developers manually write XML while exploring the sparse documentation. This is a regression for developers' experience.

    I am really trying to like GTK after using Qt a lot in the past, but there is just too much effort. Things should be as simple as VB6/WinForms. With no visual GUI editor, I find myself to just write CLI tools in Rust instead of going the extra mile and creating GUIs.

    [1] https://github.com/MicroJoe/gladis

    [2] https://github.com/MicroJoe/gtk_liststore_item

  • gtk_liststore_item

    Automatic gtk::ListStore struct derive for Rust.

  • Gtk-rs is still pretty bare bone.

    I tried to do my part by removing boilerplate using macros [1] [2], but it is still complicated to design GTK apps. Even since now, because Glade has been deprecated for GTK4 and no visual editor is available to replace it for now, making developers manually write XML while exploring the sparse documentation. This is a regression for developers' experience.

    I am really trying to like GTK after using Qt a lot in the past, but there is just too much effort. Things should be as simple as VB6/WinForms. With no visual GUI editor, I find myself to just write CLI tools in Rust instead of going the extra mile and creating GUIs.

    [1] https://github.com/MicroJoe/gladis

    [2] https://github.com/MicroJoe/gtk_liststore_item

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Gtk4-tutorial

    GTK 4 tutorial for beginners

  • gtk-rs

    Discontinued Rust bindings for GTK 3

  • I personally disagree with a lot of the changes GTK4 introduces, but I still think it's my favorite way to build quick little native apps on Linux. If you're well-versed in Rust, I really recommend checking out gtk-rs[0], a fantastic little crate with a surprisingly robust implementation. If you're familiar with 'builder' style tools (particularly Glade), your workflow will feel right at home. Plus, memory safety/type safety/good concurrency and all those other awesome Rust freebies you get.

    [0] https://gtk-rs.org/

  • Yue

    A library for creating native cross-platform GUI apps

  • I settled for Yue: https://github.com/yue/yue It's been around for several years. The deciding factor for me was that is has well maintained Lua bindings as part of the core project alongside JavaScript (Node.js) and C++.

    I didn't have much luck with libui (crashes, missing features, etc), and various immediate mode alternatives just require too many dependencies and other work that made integration too painful. Plus, Lua bindings for all these were always stale. In fact, Lua binding quality is pretty poor all around including for GTK, Qt, WxWidgets, and FLTK.

  • gtk-rs-core

    Rust bindings for GNOME libraries

  • "Automatically figuring out which parent objects the class you're subclassing derives from"

    AFAIK this is a language limitation, there is no way in a Rust macro to take a type and get all the traits that are implemented for that type.

    "Helpers for properties and signals"

    There is an open issue for this: https://github.com/gtk-rs/gtk-rs-core/issues/27

    "A flat list of methods, instead of the public/imp split"

    You can already do this in your code and use "pub fn" and "fn" like normal.

    "I feel like I had a difficult time figuring out how to share state between widgets. You end up with lots of OnceCell, Rc, and RefCell, and it quickly becomes confusing,"

    I think you are supposed to use bind_property and the gtk::Expression objects to do data binding, though that part is not so convenient to use from C or Rust either.

  • areweguiyet

    A website built for the Rust community

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Relm4

    Discontinued An idiomatic GUI library inspired by Elm and based on gtk4-rs [Moved to: https://github.com/Relm4/Relm4] (by AaronErhardt)

  • mseide-msegui

    MSEide is a Rapid Application Development IDE for platform independent rich GUI applications in the Pascal language. It comes with its own GUI toolkit called MSEgui. Binaries: https://github.com/mse-org/mseide-msegui/releases

  • https://github.com/mse-org/mseide-msegui

    Although a separate windowing set than Lazarus, both are enabled by the FreePascal compiler.

    Lazarus does have a GTK backend as an option on Linux.

  • Rocket

    A web framework for Rust.

  • Dropping by to second this statement: it really is a good example of RAD (rapid application development) for desktop software, since it supports a variety of platforms, has a UI toolkit that just works across them and doesn't need to depend on many components on the target system either, or a particular version of a particular runtime. The language is also pretty simple and doesn't feel that much worse than Java, whereas the Lazarus IDE just reminds me of NetBeans - it's no JetBrains product, but it's also perfectly passable and has everything you need.

    The compile times are also excellent, the compiler itself is decently friendly with its error messages and the runtime itself lets you write code that feels safer than C++ in most cases. Oh, and it really comes with "batteries included" - you'll find components for everything from UI elements, to database access, to working with events and such.

    Here's actually a large list of all sorts of software that has been created in it: https://wiki.freepascal.org/Projects_using_Free_Pascal

    Now, the bad things. It's basically dead.

    Sure, there are contributors who keep working and they do have a roadmap here: https://wiki.freepascal.org/Roadmap

    However, there is no hype around Pascal, many people disliked the language for a variety of reasons. No one also seems to care much about its advantages for some odd reason, instead people are talking about Electron, JavaFX/OpenJFX, .NET MAUI/Avalonia or other new technologies that attempt to do what Lazarus did many years ago, with varying degrees of success.

    Sadly, to me it seems like technologies live or die by how much hype there is around them and how many thousands of man hours people are collectively willing to put into them to create brilliance. And Lazarus doesn't have that anymore. Compare both the IDE, its approach to things, as well as Pascal nowadays with the likes of Rust - the latter gets hundreds of libraries created for it, thousands of tutorials and will have developers that literally grow up to like and use it. The former feels neglected in comparison, you won't be doing web development while utilizing super popular libraries that attempt to cover most concerns like Rocket (https://rocket.rs/) does. You also won't be interfacing with the likes of GraphQL, or even RabbitMQ, due to a lack of interest in developing libraries for those, as well as many other technologies. It might be a similar story for something like YAML or TOML.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts