creating ports dynamically

fsk's picture

ok, heres the thing. i decided to try and make a custom patch, and all is going ok. but i got stuck at trying to make input ports dynamically. the problem is, i dont have any #C experience at all :). i made the settings interface and the Stepper and text field elements that are needed but, id need to have a set method or something instead of just a property, otherwise i cant put the "addInputPortWithType: for Key:" and other stuff anywhere.

So if anyone can give me some hints how to make a property with get/set methods or some other way of achieving this id much appreciate it:).

cwright's picture
example source

We've got a few plugins that do this (the spline patch in GLTools comes to mind, as well as a few others perhaps). Check out their source code to see where the method is added.

Attaching a UI widget to the method is pretty easy -- I highly recommend reading and completing the currency converter example from Apple before taking on anything more complex with ObjC (C# isn't ObjC, btw ;) )

fsk's picture
i was looking for the source

i was looking for the source like crazy yesterday but i couldn't find it:/. its not included with the plugin download. I also couldn't find any link to source files anywhere. i guess i'm blind in some strange way:).

in the mean time im using the really nice tuts at http://cocoadevcentral.com/d/learn_objectivec/

cwright's picture
scarce

Most of our users aren't too interested in source code, so we've become a bit lax about releasing it. The older ones (early versions of GLTools, for example) should have it available on the download page. Or I can package up some current source and ship it your way, if you'd like.

fsk's picture
i managed to make the inputs

i managed to make the inputs work \o/. it was quite easy in the end. coming from actionscript its kinda hard to get used to all the types and casts and stuff, because AS really doesn't care about that:).

now im off to the sea side for some r&r, but next week when i come back id definitely like to see the source for some of these patches.