[PD] Redefining help behavior?

Orm Finnendahl finnendahl at folkwang-hochschule.de
Sun Jan 27 20:42:42 CET 2002

Am Sonntag, den 27. Januar 2002 um 10:21:42 Uhr (-0500) schrieb Larry Troxler:
> Hello, I'm trying to clean up my pd-scheme library a bit, and would like
> to implement the canvas help.
> The problem is, from the point of view of PD, I have a single extern
> where the first argument tells scheme which scheme extern to make. So I
> was hoping that I could get the help action to look up the help file
> according to this first argument and not just the class name.
> Looking at the sources, I am not sure how to do this, or even if this is
> designed to be possible. I am thinking that in my setup I would reset
> the help method for my class, but this won't work because my help action
> would need access to the object and not just the class.
> I guess the answer is that this goes against the design of PD, but I
> thought I'd post this in case there's some ideas or I'm overlooking
> something.
> Larry

If I've understood the problem well, there should be two ways of solving
your problem:

1. You define different help functions for the specific needs.  In the
   new() method you set a function (or in pd-ish) method pointer to
   the appropriate help function which should be called from within
   the help function you declared in the setup function.  This pointer
   has to be stored in the structure of your class, like any other
   local data.

2. In the new() method you store the initialization argument or a flag
   indicating which type of object it is and store THAT in the class

   Then you do a switch in the general help method and code the
   different help methods within the same function.

or am I completely missing the point?


More information about the Pd-list mailing list