» creating and deleting pins at runtime
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

creating and deleting pins at runtime

there're situations were one needs to create pins at runtime depending on the value of some config pin. for example consider the Expr (Value) node. it creates input pins for each given variable name.

with beta28 coming up this kind of task got considerably easier to do with a new interface called IIOFactory.
it basically provides a method to create so called IO containers, containing the actual "view" on the pin data (such as ISpread) and controlling the lifetime of it.

say we want to create an ISpread<ISpread<T>> during runtime, we do something like this:

[Import] 
IIOFactory FIOFactory;
...
var inputAttribute = new InputAttribute("Input Foo");
var inputFooContainer = FIOFactory.CreateIOContainer<ISpread<ISpread<T>>>(inputAttribute);
var inputFooSpread = inputFooContainer.IOObject;
...

in case we decide to get rid of those two pins which are used by inputFooSpread we simply call Dispose on the associated IO container:

...
inputFooContainer.Dispose();
...

for details and as a starting point have a look at the new dynamic plugin template contained in beta28, which creates inputs and outputs on the fly, when changing the associated config pins.

Elias, Tuesday, Aug 7th 2012 Digg | Tweet | Delicious 0 comments  
  • 1

anonymous user login

Shoutbox

~1d ago

herbst: @joreg ok, too bad! I think an interactively explorable one (like vvvvjs but doesnt need to be functional) would be great to have!

~1d ago

joreg: @herbst am afraid i can't think of any online. best open it for yourself & have a look at the examples that come with the helpbrowser

~2d ago

herbst: Just tried to show some people how concise and condensed vvvv looks even for complex stuff. Are there complex screenshots anywhere?

~4d ago

domj: Midweek Patch Therapy today at 17:30 CET! Hope to see you there https://therapy.domj.net

~4d ago

domj: Schéma + Orca + Pilot, a love triangle https://www.twitch.tv/videos/639199128

~5d ago

joreg: Your next chance for an easy introduction to the all-new #vvvv gamma: This friday 6pm CET: https://thenodeinstitute.org/event/introduction-to-creative-coding-with-vvvv-gamma-english/

~8d ago

~11d ago

domj: Stuck in your patching or eager to share what you made or came across? Join Midweek Patch Therapy at 17:30 https://therapy.domj.net/