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: treeview_d.rs
    path of file: ./repos/native-windows-gui/native-windows-gui/examples
    
    the code of the file until where you have to start completion: /*!
    An application that show how to use the TreeView control.

    Requires the following features: `cargo run --example treeview_d --features "tree-view tree-view-iterator listbox image-list frame"`
*/


extern crate native_windows_gui as nwg;
extern crate native_windows_derive as nwd;

use nwd::NwgUi;
use nwg::NativeUi;


#[derive(Default, NwgUi)]
pub struct TreeViewApp {
    
    fn button_actions(&self, btn: &nwg::Button) {
        let tv = &self.tree_view;

        if btn == &self.add_btn {
            let text = self.new_item.text();
            let item = match tv.selected_item() {
                Some(i) => { tv.insert_item(&text, Some(&i), nwg::TreeInsert::Last) },
                None => { tv.insert_item(&text, None, nwg::TreeInsert::Root) }
            };

            tv.set_item_image(&item, 1, true);
        } else if btn == &self.remove_btn {
            if let Some(item) = tv.selected_item() {
                tv.remove_item(&item);
            }
        }
    }