There's also the (currently) underutilized "send-window" method of [pointer], which forwards a message to the canvas of the scalar that [pointer] is currently pointing at.  Additionally, you can use the "traverse" method to point to the head of a glist (which doesn't even need to contain a scalar) and forward messages that way.

If you look at the canvas "get" method I added to the tracker, you'll see I have a "get parent RECEIVE-SYMBOL" message that returns a pointer to the parent canvas (or a zero if there isn't one).  This allows you to:

[bng]
|
[f $0]
|
[get parent $1-rcv]
|
[s pd-$0-mysubpatch]

[r $0-rcv]
|
[route parent]
|
[route 0]
        |
[pointer]

Now [pointer] is pointing at the parent of [pd $0-mysubpatch], so if I immediately follow this by sending the message "send-window obj 20 20 clip" to [pointer], I get a [clip] object on it's parent.  That's just a silly example, but notice it's different than sending to pd-PATCH-FILENAME.pd, which would draw a [clip] on every instance of that patch that is open.

Put this in an abstraction and it obsoletes [namecanvas].  Or create an abstraction to climb to the root, or the toplevel, etc.

-Jonathan


From: Frank Barknecht <fbar@footils.org>
To: pd-list@iem.at
Sent: Tuesday, August 2, 2011 4:14 AM
Subject: Re: [PD] [PD-announce] Pd Convention - Data structures workshop: Taking your requests

On Mon, Aug 01, 2011 at 08:59:49AM -0500, Charles Henry wrote:
> I'm mainly interested in using Pd for scientific and engineering
> research.  I have a mixed level of experience--I'm deep into the DSP
> routines, but I have no clue how data structures work.
>
> About the only application I can think of right now is a "data
> logger"--recording info about a particular trial/experiment and its
> results.
>
> I'd like to learn easy or more compact ways to accomplish things with
> data structures.
>
> I will look forward to your workshop!  Thanks much!

Data structures can be nice problem solvers in unexpected areas as well,
not only in visualizing/graphically editing data. For example, they are
used hidden away to implement a fast vanilla list sorting in the newest
[list-sort], or in the [m_symbolarray] object of the rj library to
mimick a [table] object that stores indexed symbols instead of floats.
A users of these objects never sees the data structures inside,
they don't even have a graphical representation but instead are just
used as what their name says: as data structures.

Ciao
--
Frank

_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list