Example of a simple GUI program with Iced Library (or anything simple)?

So I am trying to build a VERY simple GUI program using Rust, that could work on Windows and MacOS.
The GUI program could just need one screen.
I would like to fill in several parameters, and the program would just pass the arguments to invoke another executable file, catch the result, then display it. Basically, I just want the GUI to have some place to fill in parameters, and some area to display the result. If it can display the image then it would be awesome, but not terribly necessary.
I have looked into several GUI library in rust, and the better ones I find are Iced or Druid. However, for Druid, I cannot compile any of the example. For Iced, when I download the source code, it can compile just fine, but when I copy the .rs file separately, it just does not work. I figure it's probably due to misconfiguration in the Cargo.toml file.
For example, in the downloaded source code, the Iced library is imported as follow:

iced = { path = "../..", features = ["image", "debug"] }
env_logger = "0.8"

which used the file in the same folder, but of course it does not work for any separated project that imported the dependencies as follow:

iced = "0.2"
env_logger = "0.8"

So I basically have no example to work with, and I am quite new to Rust.
If anyway has a working GUI that would to the above function (again, just some place to fill the parameter in, and some place to display result, which is a string or something) then can I have it?
Thank you

EDIT: So mistake on my part. I did not know how to enable feature, which should be done as shown in the solution.
Also, the styling example from Iced is a great place to start for those who want a simple GUI.

What errors are you getting? For the iced example, you would definitely want to make sure the same features are enabled:

iced = { version = "0.2", features = ["image", "debug"] }
env_logger = "0.8"
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.