Skip to content

Having trouble getting an immediate viewport to come up. #5306

Answered by rustbasic
CodeCanna asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know what your exact intention is, but see below:

use eframe::egui::*;

fn main() -> eframe::Result {
    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            .with_inner_size([320.0, 240.0])
            .with_transparent(true),
        ..Default::default()
    };
    eframe::run_native(
        "My egui App",
        options,
        Box::new(|_cc| Ok(Box::<App>::default())),
    )
}

#[derive(Default)]
struct App {
    show_immediate_viewport: bool,
    _temp_value: usize,
    _text: String,
}

impl eframe::App for App {
    fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
        CentralPanel::default().show…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@CodeCanna
Comment options

@rustbasic
Comment options

Answer selected by CodeCanna
@CodeCanna
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants