diff --git a/.idea/misc.xml b/.idea/misc.xml
index a6db409..69ba99e 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -32,6 +32,8 @@
+
+
diff --git a/.idea/rust.iml b/.idea/rust.iml
index 657a62e..8f1c362 100644
--- a/.idea/rust.iml
+++ b/.idea/rust.iml
@@ -130,6 +130,13 @@
+
+
+
+
+
+
+
@@ -142,6 +149,7 @@
+
@@ -159,6 +167,7 @@
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5b7d892..3883477 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -13,21 +13,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -54,11 +42,6 @@
@@ -135,6 +123,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -166,7 +165,7 @@
-
+
@@ -194,7 +193,7 @@
-
+
@@ -213,6 +212,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -223,26 +232,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -263,6 +252,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -272,18 +271,15 @@
+
+
-
-
-
-
-
@@ -311,13 +307,15 @@
+
+
+
-
-
-
+
+
@@ -333,7 +331,7 @@
-
+
@@ -347,31 +345,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -760,13 +733,6 @@
-
-
-
-
-
-
-
@@ -776,11 +742,45 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gui/Cargo.toml b/gui/Cargo.toml
new file mode 100644
index 0000000..0f694ce
--- /dev/null
+++ b/gui/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "gui"
+version = "0.1.0"
+authors = ["Timothy Warren "]
+edition = "2018"
+
+[dependencies]
diff --git a/gui/src/lib.rs b/gui/src/lib.rs
new file mode 100644
index 0000000..31a4d7f
--- /dev/null
+++ b/gui/src/lib.rs
@@ -0,0 +1,48 @@
+//! An implementation of a "trait object",
+//! which allows dynamic dispatch for implementing types,
+//! even allowing disparate types to be called, unlike a
+//! generic, which requires one specific implementation.
+//!
+//! Trait objects have some limitations (They must be "object-safe"):
+//! * Methods can not return `Self`
+//! * Methods can not have generic type parameters
+
+/// The base trait definition
+pub trait Draw {
+ fn draw(&self);
+}
+
+/// A struct able to utilize the "trait object", via the Box type
+pub struct Screen {
+ pub components: Vec>,
+}
+
+/// A method able to call the draw method on any objects
+/// implementing the Draw "trait object"
+impl Screen {
+ pub fn run(&self) {
+ for component in self.components.iter() {
+ component.draw();
+ }
+ }
+}
+
+pub struct Button {
+ pub width: u32,
+ pub height: u32,
+ pub label: String,
+}
+
+impl Draw for Button {
+ fn draw(&self) {
+ // code to actually draw a button
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn it_works() {
+ assert_eq!(2 + 2, 4);
+ }
+}
diff --git a/gui/src/main.rs b/gui/src/main.rs
new file mode 100644
index 0000000..fcaf707
--- /dev/null
+++ b/gui/src/main.rs
@@ -0,0 +1,36 @@
+use gui::{Button, Draw, Screen};
+
+struct SelectBox {
+ width: u32,
+ height: u32,
+ options: Vec,
+}
+
+impl Draw for SelectBox {
+ fn draw(&self) {
+ // code to actually draw a select box
+ }
+}
+
+fn main() {
+ let screen = Screen {
+ components: vec![
+ Box::new(SelectBox {
+ width: 75,
+ height: 10,
+ options: vec![
+ String::from("Yes"),
+ String::from("Maybe"),
+ String::from("No")
+ ],
+ }),
+ Box::new(Button {
+ width: 50,
+ height: 10,
+ label: String::from("OK"),
+ }),
+ ],
+ };
+
+ screen.run();
+}