I’ve been meaning to get into rust for a long time, but there were some pieces missing from the ecosystem(good rust bindings for GUI applications appear to be hard to come by), but rust isn’t like most of those other languages, it requires a different approach because many of the gui frameworks that have worked historically have been object oriented, but maybe I’ve just misunderstood.
The Orbtk toolkit seemed at first to have found a sweet spot with a mixture of entity component framework patterns and a functional reactive model, it feels, well, actually not that bad to use. I wasn’t prepared for all those static &strs
that the examples pepper throughout.
The demands feel a bit different than other toolkits I’ve used. Rendering is separated from widget state, which doesn’t feel particularly helpful in this case. It’s probably just the friction from adjusting to a new way of structuring the application, but the mouthfeel isn’t very good so far.
Part of that comes from fighting the model as I figure out how exactly this pattern is meant to work, and how the graphics are rendered(so far I’m still stumped). In the meantime I’ve figured out how to use buttons.
One of the problems is the styling engine. It is very much doing things I would rather it not, such as adding hover animations to the buttons that mess up the game’s board and makes it look even worse. Disabling the style on the buttons worked fine however, so it wasn’t of too much concern.
The performance leaves much to be desired, especially when built in debug mode, though when it’s run with the release optimizations turned on, it runs acceptably. It probably doesn’t like having a hundred buttons on the screen at once, but like, that’s not really all that much to ask of a web browser or most mature toolkits.
But as I find myself managing to accomplish my goals with the GUI, I’m finding my criticism feels a bit less urgent, the performance isn’t that bad.
But that’s besides the point, while I think I might even like the toolkit, it looks very slow moving, and many of the the answers I have found to my questions were pried out of reading the source code rather than documentation, which is, where it exists, pretty alright actually.
I want to try out the other data-oriented toolkits too, especially druid, which looks quite nice.
Though, honestly, I don’t think I’m going to polish this particular implementation of this project any further, it just takes a lot more code than I think should be necessary to do anything new.
Another thing I noticed was that it tends to cause my KDE Neon install’s kwin to flicker when the applications terminate, which can be very frustrating, especially very early on when nothing you’re trying is working and you’re throwing handfuls of noodles at the wall until you find a fix.
In any case, I’m pleasantly surprised compared to the last time I tried building a GUI in rust. The frameworks I have tried have got a ways to go, but if they keep working on it, I think OrbTK could be very good with time.
Leave a Reply
Only people in my network can comment.