In g_editor.c there are canvas_cut(), canvas_copy(), and canvas_paste(). They do the obvious actions of cut/copy/paste on whole Pd chunks on Pd patches, but also they handle cut/copy/paste of the text that is inside of the msg, obj boxes and comments. That's a different mechanism, that uses Tk's clipboard.
I was wondering if there was any reason why doing a copy when editing text needs to be sent to 'pd' at all. Just a tk_textCopy should do it, no need to send a message to 'pd' to have it reply to tell Tcl to do something. There is also tk_textCut and tk_textPaste which could be used, but they would then have to send a message to 'pd' to announce the change.
.hc
----------------------------------------------------------------------------
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
I was wondering if there was any reason why doing a copy when editing text needs to be sent to 'pd' at all. Just a tk_textCopy should do it, no need to send a message to 'pd' to have it reply to tell Tcl to do something. There is also tk_textCut and tk_textPaste which could be used, but they would then have to send a message to 'pd' to announce the change.
Why look for reasons when you can just nuke the offending code.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Sep 1, 2009, at 5:03 PM, Mathieu Bouchard wrote:
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
I was wondering if there was any reason why doing a copy when editing text needs to be sent to 'pd' at all. Just a tk_textCopy should do it, no need to send a message to 'pd' to have it reply to tell Tcl to do something. There is also tk_textCut and tk_textPaste which could be used, but they would then have to send a message to 'pd' to announce the change.
Why look for reasons when you can just nuke the offending code.
Sometimes there were good reasons to do strange things in the code. Knowledge is power. Also, sometimes there are dependencies...
.hc
----------------------------------------------------------------------------
Mistrust authority - promote decentralization. - the hacker ethic
On Tue, 1 Sep 2009, Hans-Christoph Steiner wrote:
On Sep 1, 2009, at 5:03 PM, Mathieu Bouchard wrote:
Why look for reasons when you can just nuke the offending code.
Sometimes there were good reasons to do strange things in the code.
Yeah, I know that. Happens often, even.
Also, sometimes there are dependencies...
Ah. A few people use those commands in dynamic patching. But that's definitely not why it was implemented. I think it's more about Miller not wanting to learn enough of Tk... nevermind that Tcl/Tk was definitely the easiest GUI toolkit ever, at the time Miller started using it (and still competes favourably, but toolkits' ease of use change a lot with the programming language).
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801