WIP
This commit is contained in:
+32
-5
@@ -1,14 +1,41 @@
|
||||
use std::fs;
|
||||
|
||||
use fs::OpenOptions;
|
||||
use gpui::platform::{current as platform, App as _};
|
||||
use gpui::{
|
||||
executor,
|
||||
geometry::{rect::RectF, vector::vec2f},
|
||||
platform::{current as platform, App as _, Runner as _, WindowOptions},
|
||||
};
|
||||
use log::LevelFilter;
|
||||
use simplelog::SimpleLogger;
|
||||
use std::{fs, mem, rc::Rc, sync::Arc};
|
||||
|
||||
fn main() {
|
||||
init_logger();
|
||||
platform::app()
|
||||
.on_finish_launching(|| log::info!("finish launching"))
|
||||
|
||||
let platform = Arc::new(platform::app());
|
||||
|
||||
let foreground = Rc::new(
|
||||
executor::Foreground::platform(platform.dispatcher())
|
||||
.expect("could not foreground create executor"),
|
||||
);
|
||||
|
||||
platform::runner()
|
||||
.on_finish_launching(move || {
|
||||
log::info!("finish launching");
|
||||
if stdout_is_a_pty() {
|
||||
platform.activate(true);
|
||||
}
|
||||
let window = platform
|
||||
.open_window(
|
||||
WindowOptions {
|
||||
bounds: RectF::new(vec2f(0., 0.), vec2f(1024., 768.)),
|
||||
title: Some("Zed"),
|
||||
},
|
||||
foreground,
|
||||
)
|
||||
.expect("error opening window");
|
||||
|
||||
mem::forget(window); // Leak window for now so it doesn't close
|
||||
})
|
||||
.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user