[PD] sys_gui outlet WAS: create folder implementation

Hans-Christoph Steiner hans at at.or.at
Tue Jan 19 16:41:54 CET 2010


On Jan 18, 2010, at 12:44 PM, colet.patrice at free.fr wrote:

> Selon Hans-Christoph Steiner <hans at at.or.at>:
>
>
>> sys_gui.c.  That code is pretty simple. I think you could do it by
>> appending something like "; pdsend "#sys_gui-receiver bang" to every
>> command sent, then bind to the receiver name "#sys_gui-receiver" to
>> get that bang.
>
> attached diff should be this binding method but it doesn't work, the  
> bang is
> sent
> before tcl is done; why attached patch works? (it bangs after tcl  
> command is
> done), the only difference is that the send command is trigged.
>
> pc
>
> <sys_gui-send-bang.diff><createDir.pd>

Ah, the error came from [textfile] not wanting to write an empty  
file.  This works for me with your unchanged C code:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: createDir.pd
Type: application/octet-stream
Size: 390 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100119/3379f1da/attachment.obj>
-------------- next part --------------



For the outlet, I would bind to a unique receive symbol generated from  
the pointer to the instance of the sys_gui object, then use that  
receive to send the bang in Tcl, receive it in C, then output it out  
the outlet:

  sprintf(buf,"#%lx", (long unsigned int)x);


.hc

----------------------------------------------------------------------------

News is what people want to keep hidden and everything else is  
publicity.          - Bill Moyers




More information about the Pd-list mailing list