Closed mpizenberg closed 6 years ago
@mpizenberg thanks for the input!
I'm aware that there is a lot of boilerplate involved in raw conrod projects - there are a few reasons for this. A long time ago we had higher-level APIs similar to what you suggest in each backend but we ran into problems where people had different ideas about the way that event loops should be handled and we did not have enough dedication from contributors to maintain these different platform specific APIs. Users required more and more features and control over the event loop which required more platform-specific code in each backend and things felt to me like they were beginning to get a little out of hand. As a result I decided to strip conrod back to a "simpler" core which decidedly avoids supporting event loop abstractions. This made it more possible for me to keep up with conrod and moved the more opinionated event-loop related decisions and work out of conrod and into the hands of the users.
In summary, I totally agree that there is room for a much simpler API, however I think this should be the role of a downstream crate rather than conrod itself. As an example of this, I'm working on a creative coding framework called nannou which wraps conrod with a simpler UI API. The simple_ui.rs aims to demonstrate its usage. You may actually notice some similarities to elm's "model -> update -> view" approach as it was certainly part of the inspiration!
Thanks for the thoughtful answer! I totally get the explanation. I think my expectations were different because I didn't have the context. Context that could be useful to add in the "Running the Conrod Examples" section of chapter 2.
Nannou does have a very familiar approach :). I'm currently working on a computer vision project and will need visualizations similar to what we can see in this video: https://youtu.be/C6-xwSOOdqQ. So mainly images and 3D point cloud + camera visuals. Do you think that is something I can achieve more easily with nannou?
Hi, so as a beginner Rust dev, I am discovering conrod to create GUIs. Since the guide is not ready yet, I dove into the examples and was quite overwhelmed by the amount of boilerplate in those. My only experience in GUI is with the elm programming language so I might be a bit biased. Anyway, I created a helper module
program
holding aProgram
struct, with two public methods,new
andrun
:It works pretty well with the examples I've tested so far, which are
hello_world
,counter
,image
,select_list
. As an example, the hello world becomes:I find it more approachable for newcomers but wanted to ask your feedback on this. The code for the
program
module and those rewritten examples is here: https://github.com/mpizenberg/computer-vision-rs/tree/master/examples. Feel free to reuse it however it pleases you ;)Cheers, Matthieu