Creating mega widgets / grouping GUI elements

I am coming from Tcl/Tk, where the basic widget set is very basic, but Tcl includes tools and features that facilitate creating more complex “widgets” from the simplier widgets and thus creating new “mega” widgets. There are several OOP frameworks for doing this (SNIT, BWidget, and others). Is this sort of thing possible with iced? Or must one put the entire UI in one giant main.rs file?

I would like to break up my UI into several pieces in separate modules (separate .rs files). I find it easied to manage things and makes things easier to maintain. Is this possible with iced and what is the best way to do this. The documentation does not seem to provide much of a clue as to how to do this.

Just to give an idea of what kind of GUI I am looking to create, here is a screen shot of the currently working version coded in Tcl/Tk+ C++ :

I am wondering if iced is really mature enough for this sort of GUI.

Certainly doable, there are multiple existing charting/plotting iced libraries + others under active development. Compositing widgets is also rather easy, with multiple possible approaches depending on how much interactivity and complexity (as in how complex the intended widget composition is) you need.

On the “breaking up into several pieces” topic, here’s some useful reading:

I don’t see anything in that screenshot that looks particularly difficult to implement with iced versus any other framework. Just start small, read the pocket guide and unofficial guide (linked above), go through all the examples in the repo, and you should find most of what you need to build that!

Yes, I’ve built something just as complex as that. It should be fun building that in iced.

The Kraken Desktop is built entirely with iced:

https://www.kraken.com/desktop

The library almost forces you into composing your app into smaller pieces, so it should not be in one massive main.rs file. Within The Pocket Guide in the docs, there’s one subsection that talks about this:

But admittedly it’s pretty brief, so I built this one example once upon a time to help newcomers reason about how to compose applications from smaller pieces:

There are many other examples in the ecosystem that you can reference. I know you’re not a Discord user but FYI that’s where we the community is most active today

I’m also pretty sure Héctor said the graphs in Kraken just use canvas, no custom widgets there.

1 Like