You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: main.rs
    path of file: ./repos/native-windows-gui/native-windows-gui/examples/sync-draw/src
    
    the code of the file until where you have to start completion: /*!
    An application that lets you draw onto a canvas. If multiple application are running they all share the canvas.

    This is an example of a medium sized NWG application.
*/

// Disable this to show the console
#![windows_subsystem = "windows"]

extern crate n
    
    fn update_mode(&self, control: &nwg::Button) {
        let mut data = self.data.borrow_mut();

        if control == &self.pencil_btn {
            data.mode = AppMode::Draw;
        } else if control == &self.eraser_btn {
            data.mode = AppMode::Erase; 
        }

        self.status.set_text(0, &format!("Current mode: {:?}; Instances linked: {}", data.mode, data.instances_count()));
    }