we frikin did it bois
gui library works frrr implementation: - containers now store a Widget type. - every widget has a unique id - there is a data store that maps the id to the internally stored gui component. - the compoenents can be fetched from the datastore using their Widget type - the datastore uses a hashmap so fetching shouldnt have any real performance penalty. - widgets can be fetched, inserted, updated and rendered from the datastore - the render method can be called directly from the Widget type without having to know the underlying type that it references
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::any::Any;
|
||||
use crate::std::frame::{ColouredChar, Dimensions, Frame, Position, RenderError};
|
||||
use crate::user::lib::libgui::cg_core::{CgComponent, CgTextEdit};
|
||||
|
||||
@@ -56,6 +57,9 @@ impl CgComponent for CgLineEdit {
|
||||
|
||||
Ok(frame)
|
||||
}
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl CgTextEdit for CgLineEdit {
|
||||
|
||||
Reference in New Issue
Block a user