Mercurial > core / rust/ui/alik/src/main.rs
changeset 698: |
96958d3eb5b0 |
parent: |
957915316dea
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 // When compiling natively: 2 #[cfg(not(target_arch = "wasm32"))] 3 fn main() -> eframe::Result<()> { 4 // env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). 6 let mut native_options = eframe::NativeOptions { 7 viewport: egui::ViewportBuilder::default() 8 .with_inner_size([400.0, 300.0]) 9 .with_min_inner_size([300.0, 220.0]) 11 .with_decorations(true), 13 // // NOTE: Adding an icon is optional 14 // eframe::icon_data::from_png_bytes(&include_bytes!("../assets/icon-256. 15 // png")[..]) .expect("Failed to load icon"), 18 native_options.default_theme = eframe::Theme::Dark; 22 Box::new(|cc| Box::new(alik_ui::AlikApp::new(cc))), 26 // When compiling to web using trunk: 27 #[cfg(target_arch = "wasm32")] 29 // Redirect `log` message to `console.log` and friends: 30 eframe::WebLogger::init(log::LevelFilter::Debug).ok(); 32 let web_options = eframe::WebOptions::default(); 34 wasm_bindgen_futures::spawn_local(async { 35 eframe::WebRunner::new() 37 "app_canvas", // hardcode it 39 Box::new(|cc| Box::new(alik_ui::AlikApp::new(cc))), 42 .expect("failed to start eframe");