Rust UI?
Posted: Sat Apr 02, 2022 8:50 am
Hey all. I'm currently trying to prototype a desktop environment for my kernel. The whole project is meant to be in Rust. The plan is to get that macOS 6 look & feel, but to have a modern kernel underneath with support for things like preemptive multitasking and the like. The kernel is already somewhat up and running, but I wanted to prototype the desktop and UI before I continue further. I have gotten the advice to make the graphics fully userspace, so I guess I will be emulating that (?)
However, after fighting with mini_gl_fb for hours, deciding to use minifb, and finally getting a window up and running which I can draw to (the plan is to use abstractions which I can later implement in my kernel), I have run into a fundamental issue: The design which I had in my head, widgets with other widgets as children, is either hard or impossible to properly do in Rust. I keep running into the issue of needing to use dynamically sized elements in structs etc. Does anyone have an idea on what other design I could use, what structure to store and process the UI?
Any help is greatly appreciated, thank you lovely people!
P.S. I know this is a very OO way of thinking, I am kinda new to Rust...
However, after fighting with mini_gl_fb for hours, deciding to use minifb, and finally getting a window up and running which I can draw to (the plan is to use abstractions which I can later implement in my kernel), I have run into a fundamental issue: The design which I had in my head, widgets with other widgets as children, is either hard or impossible to properly do in Rust. I keep running into the issue of needing to use dynamically sized elements in structs etc. Does anyone have an idea on what other design I could use, what structure to store and process the UI?
Any help is greatly appreciated, thank you lovely people!
P.S. I know this is a very OO way of thinking, I am kinda new to Rust...