Top-rated recipes tagged "binding"http://code.activestate.com/recipes/tags/binding/top/2017-05-05T20:33:31-07:00ActiveState Code Recipesbind all tkinter "bug" (Python) 2017-05-05T20:33:31-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580795-bind-all-tkinter-bug/ <p style="color: grey"> Python recipe 580795 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/all/">all</a>, <a href="/recipes/tags/bind/">bind</a>, <a href="/recipes/tags/binding/">binding</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 3. </p> <p>This recipes tries to solve the problem of bind_all and unbind_all for tkinter.</p> <p>When a callback is registered using bind_all method and later it's unregistered using unbind_all, all the callbacks are deleted for the "all" tag event. This makes difficult to register and unregister only one callback at a time. This recipes tries to solve this problem.</p> <p>Observe the difference between the code below and the recipe. With the code below, when the user clicks nothing happens. But with my recipe it's possible to bind and unbind specific callbacks.</p> <pre class="prettyprint"><code>try: from Tkinter import Tk, Frame except ImportError: from tkinter import Tk, Frame root = Tk() f = Frame(root, width= 300, height=300) f.pack() def callback1(event): print("callback1") def callback2(event): print("callback2") def callback3(event): print("callback3") root.bind_all("&lt;1&gt;", callback1, add="+") f.bind_all("&lt;1&gt;", callback2, add="+") f.bind_all("&lt;1&gt;", callback3, add="+") f.unbind_all("&lt;1&gt;") root.mainloop() </code></pre> Inline GIF image into code (Tcl) 2002-03-18T13:47:20-08:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/117247-inline-gif-image-into-code/ <p style="color: grey"> Tcl recipe 117247 by <a href="/recipes/users/98167/">Jeff Hobbs</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>This recipe shows how to inline a GIF image directly into your Tcl code.</p> Example - Use of TclCurl. (Tcl) 2005-09-05T03:21:47-07:00Patrick Finneganhttp://code.activestate.com/recipes/users/1220635/http://code.activestate.com/recipes/440521-example-use-of-tclcurl/ <p style="color: grey"> Tcl recipe 440521 by <a href="/recipes/users/1220635/">Patrick Finnegan</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>Simplified HTTP URL retrieval using TclCurl. URL is in the format "yoursite.com/dir1/dir2/file.xml</p> Automated Form Login (Tcl) 2003-07-29T19:32:19-07:00Patrick Finneganhttp://code.activestate.com/recipes/users/1220635/http://code.activestate.com/recipes/213028-automated-form-login/ <p style="color: grey"> Tcl recipe 213028 by <a href="/recipes/users/1220635/">Patrick Finnegan</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>This script performs an automated form login against a site protected by the J2EE j_security_check model.</p> inputBox (Tcl) 2002-12-17T23:12:40-08:00Stefano Porrinohttp://code.activestate.com/recipes/users/140756/http://code.activestate.com/recipes/169762-inputbox/ <p style="color: grey"> Tcl recipe 169762 by <a href="/recipes/users/140756/">Stefano Porrino</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>Create a generic mask that's waiting for user input and returns a list of values.</p> Tcl - Babel Fish Translating Web Scraper (Tcl) 2002-12-16T06:54:51-08:00Alex Caldwellhttp://code.activestate.com/recipes/users/133437/http://code.activestate.com/recipes/168562-tcl-babel-fish-translating-web-scraper/ <p style="color: grey"> Tcl recipe 168562 by <a href="/recipes/users/133437/">Alex Caldwell</a> (<a href="/recipes/tags/binding/">binding</a>). Revision 3. </p> <p>Add multiple language real time translating ability to a Tcl/Tk application in only about 100 lines of code. I'm a doctor and I'm using it in a medical application where I need to communicate in real time with Spanish and Portuguese speaking patients and their families. Add text to speech with ViaVoice or Festival speech synthesis tools.</p> Simple Tkhtml web page displayer (Tcl) 2002-06-27T17:06:48-07:00andreas kuprieshttp://code.activestate.com/recipes/users/117230/http://code.activestate.com/recipes/136605-simple-tkhtml-web-page-displayer/ <p style="color: grey"> Tcl recipe 136605 by <a href="/recipes/users/117230/">andreas kupries</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>Author: Neil Madden Origin: <a href="http://wiki.tcl.tk/2993" rel="nofollow">http://wiki.tcl.tk/2993</a></p> <p>The application fetches a web page, formats it, and displays it in a tk scrollable widget. It currently does not handle redirecting URLs, making the web pages active, or ease of changing fonts, etc. Requires TkHTML.</p> Creating a read-only text or entry widget (Tcl) 2002-04-25T09:22:09-07:00Michael Kirkhamhttp://code.activestate.com/recipes/users/331882/http://code.activestate.com/recipes/120202-creating-a-read-only-text-or-entry-widget/ <p style="color: grey"> Tcl recipe 120202 by <a href="/recipes/users/331882/">Michael Kirkham</a> (<a href="/recipes/tags/binding/">binding</a>). Revision 2. </p> <p>A way to disallow user input in a more user (and programmer) friendly way than setting the widget's state to "disabled".</p> HTTP Posting w/ File Upload (Tcl) 2002-01-24T10:55:29-08:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/109363-http-posting-w-file-upload/ <p style="color: grey"> Tcl recipe 109363 by <a href="/recipes/users/98167/">Jeff Hobbs</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>The following script does general http posting and has support for uploading of files as well. It does this by sending the data as "multipart/form-data".</p> Example application framework (Tcl) 2001-09-20T12:50:25-07:00Paul Obermeierhttp://code.activestate.com/recipes/users/130521/http://code.activestate.com/recipes/68426-example-application-framework/ <p style="color: grey"> Tcl recipe 68426 by <a href="/recipes/users/130521/">Paul Obermeier</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>This script demonstrates how to create a Windows-alike application. It may serve as a starting point for your own applications.</p> Simple Toolbar package (Tcl) 2001-09-20T12:45:52-07:00Paul Obermeierhttp://code.activestate.com/recipes/users/130521/http://code.activestate.com/recipes/68425-simple-toolbar-package/ <p style="color: grey"> Tcl recipe 68425 by <a href="/recipes/users/130521/">Paul Obermeier</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>One possible way to implement a simple toolbar. Should be self-explaining.</p> <p>See also recipe poAppFrame for an example application framework, where this package is used.</p> <p>Have fun</p> Simple Toolhelp package (Tcl) 2001-09-20T19:42:56-07:00Paul Obermeierhttp://code.activestate.com/recipes/users/130521/http://code.activestate.com/recipes/68414-simple-toolhelp-package/ <p style="color: grey"> Tcl recipe 68414 by <a href="/recipes/users/130521/">Paul Obermeier</a> (<a href="/recipes/tags/binding/">binding</a>). Revision 2. </p> <p>One possible way to implement a toolhelp widget. Should be self-explaining.</p> <p>See also recipe poAppFrame for an example application framework, where this package is used.</p> <p>Have fun</p> Scrollable Pane (Tcl) 2001-09-11T05:51:50-07:00Donal Fellowshttp://code.activestate.com/recipes/users/99497/http://code.activestate.com/recipes/68400-scrollable-pane/ <p style="color: grey"> Tcl recipe 68400 by <a href="/recipes/users/99497/">Donal Fellows</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>Implementation of a scrollable pane in pure Tcl/Tk.</p> VW.TCL -- TK Text File Viewer (Tcl) 2001-09-10T23:35:17-07:00Tony Dyckshttp://code.activestate.com/recipes/users/115142/http://code.activestate.com/recipes/68395-vwtcl-tk-text-file-viewer/ <p style="color: grey"> Tcl recipe 68395 by <a href="/recipes/users/115142/">Tony Dycks</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>A Text File Viewer Program Utilizing a Text Widget With A Vertical Scrollbar. Menu And Button Widgets Are Used In Conjunction With a tk_getOpenFile Dialog Window To Allow The User To Select A Text File For Viewing. A Menu Option And Button Widget Enable A Program Exit Option.</p> Supporting mouse wheel on vertical scrollbars (Tcl) 2001-09-10T22:24:11-07:00Tsahi Levent-Levihttp://code.activestate.com/recipes/users/130268/http://code.activestate.com/recipes/68394-supporting-mouse-wheel-on-vertical-scrollbars/ <p style="color: grey"> Tcl recipe 68394 by <a href="/recipes/users/130268/">Tsahi Levent-Levi</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>A simple way of adding the mouse's wheel support to a TCL application</p> Color gradient image (Tcl) 2001-09-10T12:34:29-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/68392-color-gradient-image/ <p style="color: grey"> Tcl recipe 68392 by <a href="/recipes/users/98167/">Jeff Hobbs</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>This little script creates an image with the RGB and cyan, magenta, yellow color gradients.</p> LCD Number Display (Tcl) 2001-09-10T06:50:07-07:00Donal Fellowshttp://code.activestate.com/recipes/users/99497/http://code.activestate.com/recipes/68382-lcd-number-display/ <p style="color: grey"> Tcl recipe 68382 by <a href="/recipes/users/99497/">Donal Fellows</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>Display LCD digits in a canvas.</p> With busy cursor (Tcl) 2001-09-08T10:33:55-07:00Joe Englishhttp://code.activestate.com/recipes/users/99689/http://code.activestate.com/recipes/68377-with-busy-cursor/ <p style="color: grey"> Tcl recipe 68377 by <a href="/recipes/users/99689/">Joe English</a> (<a href="/recipes/tags/binding/">binding</a>). </p> <p>Tk utility - change the mouse pointer to a watch cursor, execute a script, then restore the original cursor. Works properly even if the script raises an error, [break]s, [return]s, or any other exceptional return code.</p>