<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 17, 2011, at 8:17 PM, Jonathan Wilkes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div><span>The problem is for a subpatch that isn't vis'd:</span></div><div><br><span></span></div><div><span>[inlet]</span></div><div><span>|</span></div><div><span>[checkbutton]</span></div><div><span>|</span></div><div><span>[outlet]</span></div><div><br><span></span></div><div><span>Will give an error on "bang" because checkbutton_bang has:</span></div><div><span>sys_vgui("%s invoke\n", x-&gt;widget_id-&gt;s_name);<br></span></div><div>That could be solved by using a -variable option, but then that limits you because the nonzero value cannot be changed.*</div><div><br></div><div>So yeah, the best solution is stored state in the struct so you can access it in the c functions without caring about the vis state of the obj.&nbsp; Is that the idea behind the options_binbuf?</div></div></div></blockquote><div><br></div><div>Yeah, options_binbuf is related to dumping/setting the Tk configuration for the widget. &nbsp;Once the resizing, Tk configuration saving, interaction technique, etc. is settled, then we can nail down details like what needs to happen when the Tk widget does not exist but the object receives a message.</div><br><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div>* also note that checkbutton's default behavior is the opposite from tgl:</div><div>tgl: zero = off, nonzero = on</div><div>checkbutton: onvalue = on, everything else = off<br></div></div></div></blockquote><div><br></div><div>One of the goals of tkwidgets is to have the Tk widgets represented in Pd as directly as possible. &nbsp;Then the Tk docs apply, for example. &nbsp;And it will hopefully be easier to manage more complicated configurations if there isn't a layer of abstraction between Tk and Pd.</div><div><br></div><div>If you are interested in working on tkwidgets, that would be great! &nbsp;I think the easiest place to start would be to make a 'label' object based on the Tk label widget.</div><div><br></div><div>.hc</div><div><br></div><br><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Hans-Christoph Steiner &lt;<a href="mailto:hans@at.or.at">hans@at.or.at</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> Jonathan Wilkes &lt;<a href="mailto:jancsika@yahoo.com">jancsika@yahoo.com</a>&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> pd-dev List &lt;<a href="mailto:pd-dev@iem.at">pd-dev@iem.at</a>&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, August 17, 2011 7:24 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: tkwidgets<br></font><br><div id="yiv1252287210"><br><div><div>On Aug 17, 2011, at 6:23 PM, Jonathan Wilkes wrote:</div><br class="yiv1252287210Apple-interchange-newline"><blockquote type="cite"><div><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-family:times, serif;font-size:12pt;"><div><span>How does your private git branch differ from what's currently in svn?</span></div></div></div></blockquote><div><br></div><div>I pushed my git to github, my latest work is in the 'newentry' branch. &nbsp;I basically focused on the [entry] widget to see if I could get it going with this new approach.</div><div><br></div><div><a rel="nofollow" target="_blank" href="https://github.com/pd-projects/tkwidgets">https://github.com/pd-projects/tkwidgets</a></div><br><blockquote type="cite"><div><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-family:times, serif;font-size:12pt;">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).&nbsp; 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.&nbsp; Is there some other workaround?<br></div></div></blockquote><div><br></div><div>That is true, but tkwidgets are all about using Tk widgets in Pd as easily as possible. &nbsp;If the Tk widget is not drawn to the screen, then the Tk widget is not involved. &nbsp;What is the problem in particular? &nbsp;You want to change its state while its not visible? &nbsp;I think the idea there is to have the state stored in the standard struct as a dump from the Tk widget. &nbsp;So when its not visible, store the state-changes, when it becomes visible, dump the state to the Tk widget.</div><br><blockquote type="cite"><div><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-family:times, serif;font-size:12pt;">Another thing: to get "Pd-style" interaction, bind $canvas &lt;&lt;EditMode&gt;&gt; to a proc that sets -state to disabled  for all tkwidgets in that $canvas when editmode == 1.&nbsp; That way you don't end up triggering the widget when you want to edit it.<br></div></div></blockquote><div><br></div><div>Yeah, tkwidgets was mostly written about the same time as I starting the pd-gui-rewrite. &nbsp;As I rewrote a lot of pd-gui, I realized I should wait on tkwidgets since I could fix a lot of things in pd-gui first. &nbsp;The &lt;&lt;EditMode&gt;&gt; message is one example. &nbsp;tkwdigets is not complete yet, so this is not fully in there. &nbsp;I think the [entry] in github does this kind of stuff.</div><div><br></div><div>.hc</div><br><blockquote type="cite"><div><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-family:times, serif;font-size:12pt;"><div><blockquote style="border-left-width:2px;border-left-style:solid;border-left-color:rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><font face="Arial" size="2"> Hans-Christoph Steiner &lt;<a rel="nofollow" ymailto="mailto:hans@at.or.at" target="_blank" href="mailto:hans@at.or.at">hans@at.or.at</a>&gt;<br><b><span style="font-weight:bold;">To:</span></b> Jonathan Wilkes &lt;<a rel="nofollow" ymailto="mailto:jancsika@yahoo.com" target="_blank" href="mailto:jancsika@yahoo.com">jancsika@yahoo.com</a>&gt;<br><b><span style="font-weight:bold;">Cc:</span></b> pd-dev List &lt;<a rel="nofollow" ymailto="mailto:pd-dev@iem.at" target="_blank" href="mailto:pd-dev@iem.at">pd-dev@iem.at</a>&gt;<br><b><span style="font-weight:bold;">Sent:</span></b> Wednesday, August 17, 2011 2:54 PM<br><b><span style="font-weight:bold;">Subject:</span></b> Re: tkwidgets<br></font><br><div id="yiv1252287210"><div><br></div><div>Hey Jonathan,</div><div><br></div><div>I'm cc'ing pd-dev since this is a topic that could interest others and others could contribute to. &nbsp;I've started a private git branch of tkwidgets that I intent to push once I get somewhere with it. &nbsp;The idea is to try out a new idea for how GUI objects can work. &nbsp;Basically, I think I can make it so that Tcl handles more of the interaction with the user, minimizing on pd-gui &lt;--&gt; pd communications, and making it easier to write GUI objects. &nbsp;Its not trivial to do, but should be doable.</div><div><br></div><div>.hc</div><div><br></div><br><div><div>On Aug 17, 2011, at 12:26 PM, Jonathan Wilkes wrote:</div><br class="yiv1252287210Apple-interchange-newline"><blockquote type="cite"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div><span>Never mind, I see it now inside canvas_vis... too bad canvas' "window" subcommand doesn't have something like pack's "-in" option...</span></div><div><br><span></span></div><div><span>But I guess I could make a toplevel checkbutton widget and just manually clone it.<br></span></div><div><br><span></span></div><div><span>-Jonathan<br></span></div><div><br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Jonathan Wilkes &lt;<a rel="nofollow" ymailto="mailto:jancsika@yahoo.com" target="_blank" href="mailto:jancsika@yahoo.com">jancsika@yahoo.com</a>&gt;<br><b><span style="font-weight:bold;">To:</span></b> Hans- Christoph Steiner &lt;<a rel="nofollow" ymailto="mailto:hans@at.or.at" target="_blank" href="mailto:hans@at.or.at">hans@at.or.at</a>&gt;<br><b><span style="font-weight:bold;">Sent:</span></b> Wednesday, August 17, 2011 3:14 AM<br><b><span style="font-weight:bold;">Subject:</span></b> tkwidgets<br></font><br><div id="yiv1252287210"><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div>Hi Hans,</div><div>&nbsp;&nbsp;&nbsp;&nbsp; Do I have it right that your tkwidgets get destroyed when the containing patch is vis'd 0?&nbsp; If so, any hints on how this happens?</div><div><br></div><div>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:</div><div><br></div><div>(Tcl) INVALID COMMAND NAME: invalid command name ".x252a690.c.widget25272b0"<br>&nbsp;&nbsp;&nbsp; while executing<br>".x252a690.c.widget25272b0 cget -onvalue"<br>&nbsp;&nbsp;&nbsp; ("uplevel" body line 2)<br>&nbsp;&nbsp;&nbsp; invoked from within<br>"uplevel #0 $cmd_from_pd"</div><div><br></div><div><br></div></div></div><br><br></div></div></blockquote></div></div></div></blockquote></div><br><div> <span class="yiv1252287210Apple-style-span" style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;orphans:2;white-space:normal;widows:2;word-spacing:0px;"><br class="yiv1252287210Apple-interchange-newline"><span class="yiv1252287210Apple-style-span" style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;orphans:2;white-space:normal;widows:2;word-spacing:0px;"><div><br style="font-family:Tahoma;"></div><div>----------------------------------------------------------------------------<br style="font-family:Tahoma;"></div><div><br class="yiv1252287210khtml-block-placeholder"></div><div>Man has survived hitherto because he was too ignorant to know how to realize his wishes.&nbsp;&nbsp;Now that he can realize them, he must either change them, or perish. &nbsp; &nbsp;-William Carlos Williams</div><br class="yiv1252287210Apple-interchange-newline"></span></span> </div><br></div><br><br></div></div></blockquote></div></div></div></blockquote></div><br><div> <span class="yiv1252287210Apple-style-span" style="font-size:12px;"><div><br class="yiv1252287210Apple-interchange-newline"><br></div><div>----------------------------------------------------------------------------<br></div><div><br class="yiv1252287210khtml-block-placeholder"></div><div>"We have nothing to fear from love and commitment." - New York Senator&nbsp;Diane Savino, trying to convince the NY Senate to pass a gay marriage bill</div></span> </div><br></div><br><br></div></div></blockquote></div></div></div></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br></div><div>----------------------------------------------------------------------------</div><div><br></div><div>As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; - Benjamin Franklin</div><br class="Apple-interchange-newline"></span></span> </div><br></body></html>