From 0d0d4c017c8e9b02a7a924b331838f538397d2bb Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 10 Jul 2016 19:20:06 +0200 Subject: classes/BowelyzerGUI.sc: Adding function to set the TextField of a given channel to a given String. --- classes/BowelyzerGUI.sc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/classes/BowelyzerGUI.sc b/classes/BowelyzerGUI.sc index bc5cb0a..5fc0eda 100644 --- a/classes/BowelyzerGUI.sc +++ b/classes/BowelyzerGUI.sc @@ -209,6 +209,32 @@ BowelyzerGUI{ }); } + setChannelName{ + arg name, update; + { + channels.do({|channel| + if(channel.name.asSymbol == name.asSymbol, { + ("Channel found: "++name).postln; + channel.children.do({|channelChild| + if(channelChild.name.asSymbol == \inputs, { + ("headView found").postln; + channelChild.children.do({|headView| + if(headView.name == "name", { + ("TextField for name found").postln; + headView.children.do({|nameView| + if(nameView.isKindOf(TextField), { + nameView.string_(("\""++update++"\"").asString); + }); + }); + }); + }); + }); + }); + }); + }); + }.defer; + } + // setup a single channel View by name setupChannelView{ arg name, config; -- cgit v1.2.3-70-g09d2