diff --git a/egui_node_graph/src/editor_ui.rs b/egui_node_graph/src/editor_ui.rs index 22cba21..5481aa3 100644 --- a/egui_node_graph/src/editor_ui.rs +++ b/egui_node_graph/src/editor_ui.rs @@ -111,6 +111,7 @@ where ui: &mut Ui, all_kinds: impl NodeTemplateIter, user_state: &mut UserState, + prepend_responses: Vec>, ) -> GraphResponse { // This causes the graph editor to use as much free space as it can. // (so for windows it will use up to the resizeably set limit @@ -130,7 +131,7 @@ where // The responses returned from node drawing have side effects that are best // executed at the end of this function. - let mut delayed_responses: Vec> = vec![]; + let mut delayed_responses: Vec> = prepend_responses; // Used to detect when the background was clicked let mut click_on_background = false; diff --git a/egui_node_graph_example/src/app.rs b/egui_node_graph_example/src/app.rs index ddef9f8..03b7d2f 100644 --- a/egui_node_graph_example/src/app.rs +++ b/egui_node_graph_example/src/app.rs @@ -417,8 +417,12 @@ impl eframe::App for NodeGraphExample { }); let graph_response = egui::CentralPanel::default() .show(ctx, |ui| { - self.state - .draw_graph_editor(ui, AllMyNodeTemplates, &mut self.user_state) + self.state.draw_graph_editor( + ui, + AllMyNodeTemplates, + &mut self.user_state, + Vec::default(), + ) }) .inner; for node_response in graph_response.node_responses {