3 ms·
You can avoid virtually all friction by sidestepping shared mutable references altogether and writing your GTK application in a more idomatic Rust way. For exam
by mmstick76 5y ago
You can avoid virtually all friction by sidestepping shared mutable references altogether and writing your GTK application in a more idomatic Rust way. For example, instead of passing shared references of application state to every widget signal, you can pass async Rust channels to signals. You can spawn a single async event loop attached to GLib's main context that listens for events sent from those signals, and manage all your widgets and application state in one place.
There's some libraries that effectively automate GTK in this way, such as relm4.