I added the [info complete ...] code to the pd-devel/0.41.4 branch. I think that means that I synced all your code changes into this branch, and I've added a bunch of new stuff, including translation support, fixed up the menubar to support dynamic stuff better (like the window menu).
There are some minor remaining differences in code organization, which I don't have a strong opinion on. Basically they seem unresolved, so for now I am leaving them as they are in devel.
- devel still has pd_post.tcl with pdtk_post in it - devel has ::pd_bindings::sendkey instead of pdsend_key
Then I haven't added the audio/midi/startup dialogs or pdwindow yet, just a matter of time. I think those should be dialog_*.tcl like the rest of the dialogs.
.hc
On Aug 18, 2009, at 1:06 AM, Miller Puckette wrote:
Hi Hans -
I didn't profile it -- I had to add that because otherwise my usual patch doesn't open. The trouble is that, when there are LOTS of GUI updates from Pd, sometimes the socket 'reblocks' them and something comes in that isn't complete. It's easy to get an incomplete message like "f a b" cut into "f a " and then "b", which makes tk puke if "f" needs 2 args. The only check I was able to design was to set a convention that any message that was broken by a newline had to be enclosed in braces -- so if there's a trailing newline and no brace is open, it's OK to interpret it.
I monkeyed with 3 or 4 other things and didn't keep a good log I'm afraid... the last thing I hit was for some reason the line:
# if { $::windowingsystem eq "win32" } {create_system_menu $mymenubar}
in pd_menus.tcl got up my PC's nose.
cheers M
On Tue, Aug 18, 2009 at 12:00:02AM -0400, Hans-Christoph Steiner wrote:
Hey Miller,
Just going thru the code you checked in. I noticed this in ::pd_connect::pd_readsocket, I am guessing this is the re-add any "\n" that are missing. I am curious, did you profile it at all? I was hesitant to do that because I thought it might have a big performance hit.
Here's the snippet in question:
while {![info complete $cmd_from_pd] || \ [string index $cmd_from_pd end] != "\n"} { append cmd_from_pd [read $pd_socket] if {[eof $pd_socket]} { close $pd_socket exit } }
.hc
"[T]he greatest purveyor of violence in the world today [is] my own government." - Martin Luther King, Jr.
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
----------------------------------------------------------------------------
"[T]he greatest purveyor of violence in the world today [is] my own government." - Martin Luther King, Jr.