Hello World
A simple "Hello World!".
Implementation
use gpui::{
AppContext, Application, Context, IntoElement, ParentElement, Render, Styled, Window,
WindowOptions, div, white,
};
struct RootView;
impl Render for RootView {
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
div()
.size_full()
.flex()
.items_center()
.justify_center()
.bg(white())
.child("Hello World!")
}
}
fn main() {
Application::new().run(|app| {
app.open_window(WindowOptions::default(), |_window, app| {
app.new(|_cx| RootView)
})
.unwrap();
});
}