'How stop auto refresh of egui screen

I have the following menu item

fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
    //let Self { label, value } = self; 

    // Examples of how to create different panels and windows.
    // Pick whichever suits you.
    // Tip: a good default choice is to just keep the `CentralPanel`.
    // For inspiration and more examples, go to https://emilk.github.io/egui

    egui::TopBottomPanel::top("top_panel").show(ctx, |ui| {
        // The top panel is often a good place for a menu bar:
        egui::menu::bar(ui, |ui| {
            ui.menu_button("File", |ui| {
                if ui.button("Quit").clicked() {
                    frame.quit();
                }
            });
            ui.menu_button("Items", |ui| {
                if ui.button("Exchanges").clicked() {
                    println!("Exchanges");
                    ui.close_menu();
                    exchange_trans(ctx);
                                        }
                if ui.button("Coins").clicked() {
                    println!("Coins");
                    ui.close_menu();
                }
                if ui.button("Transactions").clicked() {
                    println!("Transactions");
                    ui.close_menu();
                }
            });

I call '''

pub fn exchange_trans(ctx: &egui::Context) {
    egui::SidePanel::left("side_panel").show(ctx, |ui| {
        ui.heading("My egui Application");
    ui.horizontal(|ui| {
        ui.label("Your name: ");
        ui.group(|ui| {
            ui.label("Within a frame");
            ui.set_min_height(200.0);
        });
        
       // ui.text_edit_singleline(&mut name);
    });
}

''' The problem is that a black screen shows up when it is available to select a menu item. When I select the Exchange menu item the screen blinks and then black to black. I think the refresh rate is set to continuous and I need it set to reactive. How do I do it or am I on the wrong track.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source