[PD-dev] tkwidgets

Jonathan Wilkes jancsika at yahoo.com
Thu Aug 18 00:23:01 CEST 2011


How does your private git branch differ from what's currently in svn?
One thing I'd like to point out is that your tkwidgets suffer from the same problem tot/widget did -- by handling all the widget state in tcl you make it impossible to use your objects inside a subpatch/abstraction that doesn't have a visible canvas (because the widget no longer exists).  I was considering create a "master" widget as a child of the main window and sync it to the widget drawn on the canvas, but that seems like a lot of trouble.  Is there some other workaround?

Another thing: to get "Pd-style" interaction, bind $canvas <<EditMode>> to a proc that sets -state to disabled  for all tkwidgets in that $canvas when editmode == 1.  That way you don't end up triggering the widget when you want to edit it.

-Jonathan




>________________________________
>From: Hans-Christoph Steiner <hans at at.or.at>
>To: Jonathan Wilkes <jancsika at yahoo.com>
>Cc: pd-dev List <pd-dev at iem.at>
>Sent: Wednesday, August 17, 2011 2:54 PM
>Subject: Re: tkwidgets
>
>
>
>
>Hey Jonathan,
>
>
>I'm cc'ing pd-dev since this is a topic that could interest others and others could contribute to.  I've started a private git branch of tkwidgets that I intent to push once I get somewhere with it.  The idea is to try out a new idea for how GUI objects can work.  Basically, I think I can make it so that Tcl handles more of the interaction with the user, minimizing on pd-gui <--> pd communications, and making it easier to write GUI objects.  Its not trivial to do, but should be doable.
>
>
>.hc
>
>
>
>On Aug 17, 2011, at 12:26 PM, Jonathan Wilkes wrote:
>
>Never mind, I see it now inside canvas_vis... too bad canvas' "window" subcommand doesn't have something like pack's "-in" option...
>>
>>
>>But I guess I could make a toplevel checkbutton widget and just manually clone it.
>>
>>
>>
>>-Jonathan
>>
>>
>>
>>
>>>________________________________
>>>From: Jonathan Wilkes <jancsika at yahoo.com>
>>>To: Hans- Christoph Steiner <hans at at.or.at>
>>>Sent: Wednesday, August 17, 2011 3:14 AM
>>>Subject: tkwidgets
>>>
>>>
>>>Hi Hans,
>>>     Do I have it right that your tkwidgets get destroyed when the containing patch is vis'd 0?  If so, any hints on how this happens?
>>>
>>>
>>>Specifically, I'm playing around with [checkbutton], and even if I comment out everything in eraseme and checkbutton_free, and every single "destroy" subcommand, I still get a tcl error when sending a bang or float to a [checkbutton] that's in a subpatch with no window mapped:
>>>
>>>
>>>(Tcl) INVALID COMMAND NAME: invalid command name ".x252a690.c.widget25272b0"
>>>    while executing
>>>".x252a690.c.widget25272b0 cget -onvalue"
>>>    ("uplevel" body line 2)
>>>    invoked from within
>>>"uplevel #0 $cmd_from_pd"
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>
>----------------------------------------------------------------------------
>
>
>
>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
> 
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20110817/db95cfe8/attachment-0001.htm>


More information about the Pd-dev mailing list