fn enable(&mut self) {
        debug("Test Rust plugin enabling\n");
        debug(&format!("running time = {}\n", self.dataref.get()));

        // Get the aircraft tail number
        let tail_number_dataref: Borrowed<String, ReadOnly> = Borrowed::find("sim/aircraft/view/acf_tailnum").unwrap();
        debug(&format!("Tail number = {}\n", tail_number_dataref.get()));

        let dataref_copy = self.dataref.clone();
        let flight_loop = FlightLoop::new(Phase::AfterFlightModel, move || {
            debug(&format!("Flight loop callback running. time = {}\n", dataref_copy.get()));
            NextCallback::after_seconds(1.0)
        });
        flight_loop.schedule(NextCallback::after_seconds(1.0));
        self.flight_loop = Some(flight_loop);

        self.probe_test = Some(ProbeTestHolder::new());

        let button_listener = || {
            debug("Button pressed\n");
        };
        let checkbox_listener = |checked: bool| {
            debug(&format!("Check box value changed: checked = {}\n", checked));
        };

        let mut window = Window::new("Rust Window", &Rect{ left: 100, top: 400, right: 600, bottom: 100 });
        let pane = Pane::new("Pane", &Rect{ left: 120, top: 370, right: 580, bottom: 120 });

        let button = Button::new("Eat Pie", &Rect{ left: 130, top: 140, right: 200, bottom: 130 }, button_listener);
        let checkbox = CheckBox::new(&Rect{ left: 130, top: 160, right: 200, bottom: 150 }, checkbox_listener);


        window.add_child(Box::new(pane));
        window.add_child(Box::new(button));
        window.add_child(Box::new(checkbox));
        window.set_visible(true);
        self.window = Some(window);
    }
/// Called when the plugin is enabled
Called when the plugin is enabled
Called when the plugin is enabled
fn enable(&mut self) {
        debug("Test Rust plugin enabling\n");
        debug(&format!("running time = {}\n", self.dataref.get()));
        // Get the aircraft tail number
        let tail_number_dataref: Borrowed<String, ReadOnly> = Borrowed::find("sim/aircraft/view/acf_tailnum").unwrap();
        debug(&format!("Tail number = {}\n", tail_number_dataref.get()));
        let dataref_copy = self.dataref.clone();
        let flight_loop = FlightLoop::new(Phase::AfterFlightModel, move || {
            debug(&format!("Flight loop callback running. time = {}\n", dataref_copy.get()));
            NextCallback::after_seconds(1.0)
        });
        flight_loop.schedule(NextCallback::after_seconds(1.0));
        self.flight_loop = Some(flight_loop);
        self.probe_test = Some(ProbeTestHolder::new());
        let button_listener = || {
            debug("Button pressed\n");
        };
        let checkbox_listener = |checked: bool| {
            debug(&format!("Check box value changed: checked = {}\n", checked));
        };
        let mut window = Window::new("Rust Window", &Rect{ left: 100, top: 400, right: 600, bottom: 100 });
        let pane = Pane::new("Pane", &Rect{ left: 120, top: 370, right: 580, bottom: 120 });
        let button = Button::new("Eat Pie", &Rect{ left: 130, top: 140, right: 200, bottom: 130 }, button_listener);
        let checkbox = CheckBox::new(&Rect{ left: 130, top: 160, right: 200, bottom: 150 }, checkbox_listener);
        window.add_child(Box::new(pane));
        window.add_child(Box::new(button));
        window.add_child(Box::new(checkbox));
        window.set_visible(true);
        self.window = Some(window);
    }
fn enable ( & mut self ) { debug ( " \n " ) ; debug ( & format ! ( " \n " self dataref get ( ) ) ) ; // Get the aircraft tail number let tail_number_dataref : Borrowed < String , ReadOnly > = Borrowed :: find ( " " ) . unwrap ( ) ; debug ( & format ! ( " \n " tail_number_dataref get ( ) ) ) ; let dataref_copy = self . dataref . clone ( ) ; let flight_loop = FlightLoop :: new ( Phase :: AfterFlightModel , move | | { debug ( & format ! ( " \n " dataref_copy get ( ) ) ) ; NextCallback :: after_seconds ( 1.0 ) } ) ; flight_loop . schedule ( NextCallback :: after_seconds ( 1.0 ) ) ; self . flight_loop = Some ( flight_loop ) ; self . probe_test = Some ( ProbeTestHolder :: new ( ) ) ; let button_listener = | | { debug ( " \n " ) ; } ; let checkbox_listener = | checked : bool | { debug ( & format ! ( " \n " checked ) ) ; } ; let mut window = Window :: new ( " " , & Rect { left : 100 , top : 400 , right : 600 , bottom : 100 } ) ; let pane = Pane :: new ( " " , & Rect { left : 120 , top : 370 , right : 580 , bottom : 120 } ) ; let button = Button :: new ( " " , & Rect { left : 130 , top : 140 , right : 200 , bottom : 130 } , button_listener ) ; let checkbox = CheckBox :: new ( & Rect { left : 130 , top : 160 , right : 200 , bottom : 150 } , checkbox_listener ) ; window . add_child ( Box :: new ( pane ) ) ; window . add_child ( Box :: new ( button ) ) ; window . add_child ( Box :: new ( checkbox ) ) ; window . set_visible ( true ) ; self . window = Some ( window ) ; }
Called when the plugin is enabled
Called when the plugin is enabled
&mut self
&mut self