MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / show_node_menu

Method show_node_menu

examples/visual_node_graph/src/ui.rs:394–415  ·  view source on GitHub ↗
(
        &mut self,
        node: egui_snarl::NodeId,
        _inputs: &[InPin],
        _outputs: &[OutPin],
        ui: &mut Ui,
        snarl: &mut Snarl<GuiAudioNode>,
    )

Source from the content-addressed store, hash-verified

392 }
393
394 fn show_node_menu(
395 &mut self,
396 node: egui_snarl::NodeId,
397 _inputs: &[InPin],
398 _outputs: &[OutPin],
399 ui: &mut Ui,
400 snarl: &mut Snarl<GuiAudioNode>,
401 ) {
402 let n = snarl.get_node(node).unwrap();
403
404 match &n.node {
405 GuiAudioNodeType::SystemIn | GuiAudioNodeType::SystemOut => {}
406 _ => {
407 ui.label("Node menu");
408 if ui.button("Remove").clicked() {
409 self.audio_system.remove_node(n.id);
410 snarl.remove_node(node);
411 ui.close_kind(UiKind::Menu);
412 }
413 }
414 }
415 }
416
417 fn has_on_hover_popup(&mut self, _: &GuiAudioNode) -> bool {
418 false

Callers

nothing calls this directly

Calls 1

remove_nodeMethod · 0.45

Tested by

no test coverage detected