How to add components to GTK application

fn gui_application()
{
    let app = Application::builder()
        .application_id("gui")
        .build();
    app.connect_activate(build_ui);
    app.run();
}
fn build_ui(app: &Application) {

    let _tree_view = TreeView::builder()
        .headers_visible(true)
        .enable_tree_lines(true)
        .enable_search(true)
        .build();
    let window = ApplicationWindow::builder()
        .application(app) 
        .maximized(true)
        .visible(true)
        .add(&_tree_view)
        .build();
    window.present();
}

My attempt to add treeview to windows failed. Prompt method cannot be called on applicationwindowbuilder due to unsatisfied trail boundaries
Thanks for your help!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.