I'm playing around with some GUI behaviors, and I was wondering if anyone knows a way to tell that the patch is finished loading and 'pd' has finished sending all of the Tcl/sys_gui drawing commands.
This would be a very useful hook for attaching Tcl procs for making dynamic GUI behaviors.
.hc
----------------------------------------------------------------------------
All mankind is of one author, and is one volume; when one man dies, one chapter is not torn out of the book, but translated into a better language; and every chapter must be so translated.... -John Donne
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
I'm playing around with some GUI behaviors, and I was wondering if anyone knows a way to tell that the patch is finished loading and 'pd' has finished sending all of the Tcl/sys_gui drawing commands. This would be a very useful hook for attaching Tcl procs for making dynamic GUI behaviors.
just ping the client... depends a bit on the branch...
miller: sys_gui("pd %s done \;\n",rcv->s_name); hans: sys_gui("pdsend "%s done"\n",rcv->s_name); matju: sys_gui("netsend "%s done"\n",rcv->name);
provided that you have done pd_bind((t_pd *)self,rcv); and a class_addmethod for the name "done" (the callback).
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Sep 1, 2009, at 4:55 PM, Mathieu Bouchard wrote:
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
I'm playing around with some GUI behaviors, and I was wondering if anyone knows a way to tell that the patch is finished loading and 'pd' has finished sending all of the Tcl/sys_gui drawing commands. This would be a very useful hook for attaching Tcl procs for making dynamic GUI behaviors.
just ping the client... depends a bit on the branch...
miller: sys_gui("pd %s done \;\n",rcv->s_name); hans: sys_gui("pdsend "%s done"\n",rcv->s_name); matju: sys_gui("netsend "%s done"\n",rcv->name);
provided that you have done pd_bind((t_pd *)self,rcv); and a class_addmethod for the name "done" (the callback).
Are there any existing methods? I am actually thinking Tcl/GUI side.
.hc
----------------------------------------------------------------------------
Man has survived hitherto because he was too ignorant to know how to realize his wishes. Now that he can realize them, he must either change them, or perish. -William Carlos Williams
I don't think there's any existing way to do it--- time to design some appropriate hooks :)
M
On Tue, Sep 01, 2009 at 05:23:26PM -0400, Hans-Christoph Steiner wrote:
On Sep 1, 2009, at 4:55 PM, Mathieu Bouchard wrote:
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
I'm playing around with some GUI behaviors, and I was wondering if anyone knows a way to tell that the patch is finished loading and 'pd' has finished sending all of the Tcl/sys_gui drawing commands. This would be a very useful hook for attaching Tcl procs for making dynamic GUI behaviors.
just ping the client... depends a bit on the branch...
miller: sys_gui("pd %s done \;\n",rcv->s_name); hans: sys_gui("pdsend "%s done"\n",rcv->s_name); matju: sys_gui("netsend "%s done"\n",rcv->name);
provided that you have done pd_bind((t_pd *)self,rcv); and a class_addmethod for the name "done" (the callback).
Are there any existing methods? I am actually thinking Tcl/GUI side.
.hc
Man has survived hitherto because he was too ignorant to know how to realize his wishes. Now that he can realize them, he must either change them, or perish. -William Carlos Williams
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hallo, Miller Puckette hat gesagt: // Miller Puckette wrote:
I don't think there's any existing way to do it--- time to design some appropriate hooks :)
Actually at RjDj we would also appreciate a hook for telling the user when a "scene" has been fully loaded and displaying a kind of hourglass while the patch is still loading. Ideally this would also wait for the time objects like textfile or soundfiler take for loading their files.
Ciao
On Sep 2, 2009, at 2:30 AM, Frank Barknecht wrote:
Hallo, Miller Puckette hat gesagt: // Miller Puckette wrote:
I don't think there's any existing way to do it--- time to design some appropriate hooks :)
Actually at RjDj we would also appreciate a hook for telling the user when a "scene" has been fully loaded and displaying a kind of hourglass while the patch is still loading. Ideally this would also wait for the time objects like textfile or soundfiler take for loading their files.
Any ideas how this message "patch loaded" message should look like? It should be something like the symbol "loaded" sent to the canvas's receive symbol (i.e. [receive pd-mypatch.pd]).
It would be nice to have the status outlet on textfile, soundfiler, etc. have more messages like that. The problem is breaking backwards compatibility. I could seem them outputting "loaded" once they are done. But that case seems more like it should be in the object itself.
.hc
----------------------------------------------------------------------------
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
just ping the client... depends a bit on the branch... miller: sys_gui("pd %s done \;\n",rcv->s_name); hans: sys_gui("pdsend "%s done"\n",rcv->s_name); matju: sys_gui("netsend "%s done"\n",rcv->name); provided that you have done pd_bind((t_pd *)self,rcv); and a class_addmethod for the name "done" (the callback).
Are there any existing methods?
I stated it, therefore it exists.
I suppose it depends on your school of ontology.
I am actually thinking Tcl/GUI side.
You can't get out of this question without thinking with both sides.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Sep 2, 2009, at 11:22 AM, Mathieu Bouchard wrote:
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
just ping the client... depends a bit on the branch... miller: sys_gui("pd %s done \;\n",rcv->s_name); hans: sys_gui("pdsend "%s done"\n",rcv->s_name); matju: sys_gui("netsend "%s done"\n",rcv->name); provided that you have done pd_bind((t_pd *)self,rcv); and a class_addmethod for the name "done" (the callback).
Are there any existing methods?
I stated it, therefore it exists.
I suppose it depends on your school of ontology.
I am actually thinking Tcl/GUI side.
You can't get out of this question without thinking with both sides.
Well, I found a little hack way to do it. It turns out that 'pd' sends this proc when its done loading:
pdtk_canvas_getscroll .x64b920.c
And normally pdtk_canvas_getscroll is called with the toplevel path of .x64b920, for some reason when it finishes loading it calls pdtk_canvas_getscroll with the canvas name .x64b920.c. So I added a ::loaded array, so you can check to see if a given toplevel .x64b920 is loaded. ::loaded(.x64b920) is first set to 0 when pdtk_canvas_new is called, then when pdtk_canvas_getscroll .x64b920.c is first received, ::loaded(.x64b920) is set to 1. So you can "trace add variable ::loaded write" in order to run a proc when a patch has finished loading. Works for me in my 'editmode_look.tcl' plugin.
.hc
----------------------------------------------------------------------------
There is no way to peace, peace is the way. -A.J. Muste
On Fri, 11 Sep 2009, Hans-Christoph Steiner wrote:
Well, I found a little hack way to do it. It turns out that 'pd' sends this proc when its done loading: pdtk_canvas_getscroll .x64b920.c
Please try not to duck-tape yourself in a corner.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Sep 11, 2009, at 11:34 AM, Mathieu Bouchard wrote:
On Fri, 11 Sep 2009, Hans-Christoph Steiner wrote:
Well, I found a little hack way to do it. It turns out that 'pd' sends this proc when its done loading: pdtk_canvas_getscroll .x64b920.c
Please try not to duck-tape yourself in a corner.
Indeed. I am interested in establishing an API. That's the ::loaded array. How it gets setup can then be easily changed without affecting things that use ::loaded.
.hc
----------------------------------------------------------------------------
"[T]he greatest purveyor of violence in the world today [is] my own government." - Martin Luther King, Jr.
On Fri, 11 Sep 2009, Hans-Christoph Steiner wrote:
On Sep 11, 2009, at 11:34 AM, Mathieu Bouchard wrote:
Please try not to duck-tape yourself in a corner.
Indeed. I am interested in establishing an API.
aah, good!
That's the ::loaded array.
I find it a strange turn-around of our traditional opposition when I'm going to suggest that you could be using a longer name, but that's what it is. "::loaded" doesn't say what kind of things are the loaded things in question, and sometimes it's good to imply the nouns, but only when the noun is super-obvious from context, or very vague (e.g. getStuff, getThing and getElement may as well be called just "get").
How it gets setup can then be easily changed without affecting things that use ::loaded.
Some people would advise against using the 'trace' feature, saying it's ugly, but you don't have to listen to them. i'm not against it, and there's no reason not to use it apart from programmers who don't want to learn it or have other religious reasons against it (if it's not in JAVA it must be because it's evil, etc).
The 'trace' feature can cause tremendous slowdowns, but only when you ask it to make tremendous effort. Tracing seldom-used vars doesn't cost much runtime.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801