Re: [PD-dev] erase object text

2011-04-03 Thread yvan volochine

On 04/03/2011 01:53 AM, Hans-Christoph Steiner wrote:

Have you tried watching the actual traffic that pd-gui sends to pd? Run
pd from the command line like 'pd -stderr -d 3' and you'll see the
communications between pd and pd-gui. -d 1 would be one direction of
that traffic, and -d 2 would be the other direction, but I forget which
is which.

That way you can figure out which messages are the ones that you want to
hijack :)


thanks for the tip
I assumed that CTRL-A would select the text in a box but I was wrong.
I found a way by simulating backspace key though.

cheers,
_y

___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] erase object text

2011-04-02 Thread yvan volochine

On 04/01/2011 11:29 PM, yvan volochine wrote:

On 04/01/2011 10:43 PM, Miller Puckette wrote:

Can't be done -- the actual text editing is done in Pd and the TCL
code is just to display the current state of affairs down in Pd.

There might be a way to do it via messages to Pd though -- for instance,
simlulating the necessary mouse/keyboard actions.


ah yes, that works if I simulate a double-click.


it seems that simulating the mouse is a bad idea (focus problems).
how would I go to simulate CTRL-A ??

this does not work:

proc ctrl_all {} {
...
set key Control_L
set a 97

pdsend $mytoplevel key 1 $key 0
pdsend $mytoplevel key 1 $a 0
pdsend $mytoplevel key 0 $a 0
pdsend $mytoplevel key 0 $key 0
}

cheers,
_y

___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] erase object text

2011-04-02 Thread yvan volochine

On 04/02/2011 05:38 PM, yvan volochine wrote:

On 04/01/2011 11:29 PM, yvan volochine wrote:

On 04/01/2011 10:43 PM, Miller Puckette wrote:

Can't be done -- the actual text editing is done in Pd and the TCL
code is just to display the current state of affairs down in Pd.

There might be a way to do it via messages to Pd though -- for instance,
simlulating the necessary mouse/keyboard actions.


ah yes, that works if I simulate a double-click.


it seems that simulating the mouse is a bad idea (focus problems).
how would I go to simulate CTRL-A ??

this does not work:

proc ctrl_all {} {
...
set key Control_L
set a 97

pdsend $mytoplevel key 1 $key 0


actually this should be better but it also does not work:

pdsend $mytoplevel selectall

in pd, it seems that CTRL-A just releases the object.

_y

___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] erase object text

2011-04-02 Thread Hans-Christoph Steiner


On Apr 2, 2011, at 11:57 AM, yvan volochine wrote:


On 04/02/2011 05:38 PM, yvan volochine wrote:

On 04/01/2011 11:29 PM, yvan volochine wrote:

On 04/01/2011 10:43 PM, Miller Puckette wrote:

Can't be done -- the actual text editing is done in Pd and the TCL
code is just to display the current state of affairs down in Pd.

There might be a way to do it via messages to Pd though -- for  
instance,

simlulating the necessary mouse/keyboard actions.


ah yes, that works if I simulate a double-click.


it seems that simulating the mouse is a bad idea (focus problems).
how would I go to simulate CTRL-A ??

this does not work:

proc ctrl_all {} {
...
set key Control_L
set a 97

pdsend $mytoplevel key 1 $key 0


actually this should be better but it also does not work:

pdsend $mytoplevel selectall

in pd, it seems that CTRL-A just releases the object.



Have you tried watching the actual traffic that pd-gui sends to pd?   
Run pd from the command line like 'pd -stderr -d 3' and you'll see the  
communications between pd and pd-gui.  -d 1 would be one direction of  
that traffic, and -d 2 would be the other direction, but I forget  
which is which.


That way you can figure out which messages are the ones that you want  
to hijack :)


.hc




Programs should be written for people to read, and only incidentally  
for machines to execute.

 - from Structure and Interpretation of Computer Programs


___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] erase object text

2011-04-01 Thread Miller Puckette
Can't be done -- the actual text editing is done in Pd and the TCL
code is just to display the current state of affairs down in Pd.

There might be a way to do it via messages to Pd though -- for instance,
simlulating the necessary mouse/keyboard actions.

cheers
Miller

On Fri, Apr 01, 2011 at 08:49:40PM +0200, yvan volochine wrote:
 hi,
 
 is there a way to erase the text from an object box that's being
 edited (in tcl) ?
 I tryed with pdtk_sekectall and pdtk_text_set but I couldn't get it
 to work (pd keeps the 'old' text).
 
 cheers,
 _y
 
 ___
 Pd-dev mailing list
 Pd-dev@iem.at
 http://lists.puredata.info/listinfo/pd-dev

___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] erase object text

2011-04-01 Thread yvan volochine

On 04/01/2011 10:43 PM, Miller Puckette wrote:

Can't be done -- the actual text editing is done in Pd and the TCL
code is just to display the current state of affairs down in Pd.

There might be a way to do it via messages to Pd though -- for instance,
simlulating the necessary mouse/keyboard actions.


ah yes, that works if I simulate a double-click.
auto-completion is getting closer =)

cheers,
_y

___
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev