Most viewed recipes tagged "ui"http://code.activestate.com/recipes/tags/ui/views/2014-09-04T09:34:16-07:00ActiveState Code RecipesDownloading a File from the Web (Python) 2007-06-13T09:15:37-07:00Aristotelis Mikropouloshttp://code.activestate.com/recipes/users/2881737/http://code.activestate.com/recipes/496685-downloading-a-file-from-the-web/ <p style="color: grey"> Python recipe 496685 by <a href="/recipes/users/2881737/">Aristotelis Mikropoulos</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>This script reads the contents of a web file and copies them into a local file, named the same as the web file.</p> MultiListbox Tkinter widget (Python) 2001-03-14T17:42:44-08:00Brent Burleyhttp://code.activestate.com/recipes/users/98036/http://code.activestate.com/recipes/52266-multilistbox-tkinter-widget/ <p style="color: grey"> Python recipe 52266 by <a href="/recipes/users/98036/">Brent Burley</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>This is a compound widget that gangs multiple Tk Listboxes to a single scrollbar to achieve a simple multi-column scrolled listbox. Most of the Listbox API is mirrored to make it act like the normal Listbox but with multiple values per row.</p> Romantic love poem in Python (Python) 2014-09-04T09:34:16-07:00Damian Parniewiczhttp://code.activestate.com/recipes/users/2913290/http://code.activestate.com/recipes/496781-romantic-love-poem-in-python/ <p style="color: grey"> Python recipe 496781 by <a href="/recipes/users/2913290/">Damian Parniewicz</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>This recipe was written for my beautiful girl...however signification of this code is universal</p> Easy Cross Platform Excel Parsing With Xlrd (Python) 2006-04-07T22:45:51-07:00Bryan Niederbergerhttp://code.activestate.com/recipes/users/2843232/http://code.activestate.com/recipes/483742-easy-cross-platform-excel-parsing-with-xlrd/ <p style="color: grey"> Python recipe 483742 by <a href="/recipes/users/2843232/">Bryan Niederberger</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>Easily extract data from microsoft excel files using this wrapper class for xlrd (<a href="http://www.lexicon.net/sjmachin/xlrd.htm" rel="nofollow">http://www.lexicon.net/sjmachin/xlrd.htm</a>). The class allows you to create a generator which returns excel data one row at a time as either a list or dictionary. I found this very handy for easily pulling in a variety of excel files without having to deal with COM calls or even needing to have windows.</p> Stopwatch in Tkinter (Python) 2002-05-23T13:51:38-07:00Jørgen Cederberghttp://code.activestate.com/recipes/users/359004/http://code.activestate.com/recipes/124894-stopwatch-in-tkinter/ <p style="color: grey"> Python recipe 124894 by <a href="/recipes/users/359004/">Jørgen Cederberg</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 2. </p> <p>This is a small implementation of a stopwatch widget in Tkinter. The widget displays a label with minutes:seconds:1/100-seconds. The label is updated every 50 ms, but that can easily be changed. Methods are availble for starting, stopping and resetting the stopwatch. A simple program demonstrates the widget.</p> Set Process Priority In Windows (Python) 2006-06-02T07:05:41-07:00Bryan Niederbergerhttp://code.activestate.com/recipes/users/2843232/http://code.activestate.com/recipes/496767-set-process-priority-in-windows/ <p style="color: grey"> Python recipe 496767 by <a href="/recipes/users/2843232/">Bryan Niederberger</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>This function allows you to set process priority under windows. It defaults to setting the priority of the current python process but can set anything for which you have a process ID. I find it handy to set a long-running job with lower than normal priority so the computer doesn't feel sluggish while it runs.</p> Determine size of console window on Windows (Python) 2006-04-29T20:26:33-07:00Alexander Belchenkohttp://code.activestate.com/recipes/users/2623877/http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/ <p style="color: grey"> Python recipe 440694 by <a href="/recipes/users/2623877/">Alexander Belchenko</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>This recipe is Python implementation of few lines of C-code that get useful information about current working console on Windows. It may be useful for console application to proper formatting output. Recipe need ctypes package to be installed.</p> <p>This is the second version of recipe. When use handle of stdout for determining size of console and connect output of program via pipe to another program (e.g. pager 'more') then you get default 80x25 size. In case of using handle of stderr for this purpose then pipe don't destroy actual size.</p> A simple Tkinter notebook-like widget (Python) 2004-12-26T19:11:42-08:00Iuri Wickerthttp://code.activestate.com/recipes/users/111694/http://code.activestate.com/recipes/188537-a-simple-tkinter-notebook-like-widget/ <p style="color: grey"> Python recipe 188537 by <a href="/recipes/users/111694/">Iuri Wickert</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 4. </p> <p>You have some single-toplevel Tkinter apps that you want to organize in a notebook-like fashion, associating each tab to an app, in a way which requires minimal changes in your original apps. This simple notebook class allows that, also supporting different tab orientations (TOP, BOTTOM, LEFT &amp; RIGHT).</p> Call a Callback when a Tkinter.Text is Modified (Python) 2005-12-15T23:00:43-08:00Simon Formanhttp://code.activestate.com/recipes/users/2702520/http://code.activestate.com/recipes/464635-call-a-callback-when-a-tkintertext-is-modified/ <p style="color: grey"> Python recipe 464635 by <a href="/recipes/users/2702520/">Simon Forman</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 2. </p> <p>A Tkinter.Text can notice when its contents are changed. This recipe shows how to make use of the virtual event this generates to call your own callback.</p> Building GTK GUIs interactively (Python) 2001-09-27T15:49:21-07:00Brian McErleanhttp://code.activestate.com/recipes/users/111980/http://code.activestate.com/recipes/65109-building-gtk-guis-interactively/ <p style="color: grey"> Python recipe 65109 by <a href="/recipes/users/111980/">Brian McErlean</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>One of pythons greatest strengths is the ability to try things interactively at the interpreter. Using Tkinter shares this strength, since one can create buttons, windows and other widgets, and instantly see them onscreen, click on buttons to activate callbacks and still be able to edit and add to the widgets from the python command line.</p> <p>While the python GTK bindings are generally excellent, one of their flaws is that this is not possible. Before anything is actually displayed, the gtk.mainloop() function must be called, ending the possibility of interactive manipulation.</p> <p>This recipe is a program which simulates a python interpreter which transparently allows the user to use gtk widgets without having to call mainloop(), in much the same way as Tk widgets.</p> <p>This latest version contains enhancements added by Christian Robottom Reis to add readline completion support.</p> Using code.InteractiveConsole to embed a Python shell in a user interface (Python) 2004-12-02T10:07:39-08:00Rick Mullerhttp://code.activestate.com/recipes/users/1461790/http://code.activestate.com/recipes/355319-using-codeinteractiveconsole-to-embed-a-python-she/ <p style="color: grey"> Python recipe 355319 by <a href="/recipes/users/1461790/">Rick Muller</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>The code module provides the ability to write your own Python shell, which you can use to filter out input or output, and embed it in another application. This recipe shows how this module can be used.</p> Changing the background color of the menu bar in a wxPython Windows app (Python) 2005-09-02T19:09:28-07:00Kartic Krishnamurthyhttp://code.activestate.com/recipes/users/2570233/http://code.activestate.com/recipes/440507-changing-the-background-color-of-the-menu-bar-in-a/ <p style="color: grey"> Python recipe 440507 by <a href="/recipes/users/2570233/">Kartic Krishnamurthy</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 2. </p> <p>Using win32 API to change the background color of the menubar/menu items in a wxPython app without affecting system-wide settings.</p> Inline GIF's with Tkinter (Python) 2004-01-30T16:43:32-08:00Brent Burleyhttp://code.activestate.com/recipes/users/98036/http://code.activestate.com/recipes/52264-inline-gifs-with-tkinter/ <p style="color: grey"> Python recipe 52264 by <a href="/recipes/users/98036/">Brent Burley</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 2. </p> <p>This recipe will let you embed GIF images inside of your source code for use in Tkinter buttons, labels, etc. It's really handy for making toolbars, etc. without worrying about having the right icon files installed.</p> <p>The basic technique is to encode the GIF with base64 and store it as a string literal in the Python code to be passed to Tk PhotoImage.</p> Manipulate Mac OS clipboard (Python) 2005-04-21T18:38:38-07:00Artur de Sousa Rochahttp://code.activestate.com/recipes/users/343771/http://code.activestate.com/recipes/410615-manipulate-mac-os-clipboard/ <p style="color: grey"> Python recipe 410615 by <a href="/recipes/users/343771/">Artur de Sousa Rocha</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>This is a clipboard manipulation module that demonstrates some simple use of Carbon API. It can double as a Unix-style command-line tool that prints the clipboard contents to stdout or, if specified, copies its stdin to the clipboard, although pbcopy(1) and pbpaste(1) are better suited for that.</p> ExtraMenu - a TkInter menu with arbitrary widgets as sub-menus (Python) 2005-10-31T11:46:10-08:00Jim Segravehttp://code.activestate.com/recipes/users/2647775/http://code.activestate.com/recipes/442500-extramenu-a-tkinter-menu-with-arbitrary-widgets-as/ <p style="color: grey"> Python recipe 442500 by <a href="/recipes/users/2647775/">Jim Segrave</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>A variant of a Tkinter Menu which allos sub-menus to: automatically open/close when the controlling button is active/inactive sub-menus can be instances of any arbitrary widget, such as a Pmw.ComboBox</p> Using a wxPython "Notebook" with panels (Python) 2001-06-19T22:26:42-07:00Mark Nenadovhttp://code.activestate.com/recipes/users/114221/http://code.activestate.com/recipes/65249-using-a-wxpython-notebook-with-panels/ <p style="color: grey"> Python recipe 65249 by <a href="/recipes/users/114221/">Mark Nenadov</a> (<a href="/recipes/tags/ui/">ui</a>). Revision 3. </p> <p>wxPython provides a powerul functionality that allows you to use a "Notebook" user interface with multiple panels - whose interface each is determined by individual Python scripts. Each panel runs in the background (even when it is not selected), and maintains the state it is in as the user switches back and forth.</p> Get the actual and usable sizes of all the monitors on a multi-monitor Windows system (Python) 2005-12-02T12:17:38-08:00Martin Denglerhttp://code.activestate.com/recipes/users/2688909/http://code.activestate.com/recipes/460509-get-the-actual-and-usable-sizes-of-all-the-monitor/ <p style="color: grey"> Python recipe 460509 by <a href="/recipes/users/2688909/">Martin Dengler</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>This recipe gets the sizes of all the monitors on a multi-monitor Windows PC. It gets both the actual resolution and the usable ("work") resolutions. The usable resolution excludes the taskbar and docked applications.</p> Easily creating dialog boxes from XRC files (Python) 2006-07-06T14:39:56-07:00Walker Halehttp://code.activestate.com/recipes/users/2928779/http://code.activestate.com/recipes/496868-easily-creating-dialog-boxes-from-xrc-files/ <p style="color: grey"> Python recipe 496868 by <a href="/recipes/users/2928779/">Walker Hale</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>This module allows creating and running a custom dialog box with a single function call. The custom dialog box must first be defined in an external XRC file. Editors like XRCed and wxGlade allow easily designing custom dialog boxes. You can then invoke the dialog box even if your application has no other GUI.</p> Using python scripts without .py extension in DOS shells (Python) 2006-03-30T07:30:05-08:00Michael Soulierhttp://code.activestate.com/recipes/users/2712185/http://code.activestate.com/recipes/476204-using-python-scripts-without-py-extension-in-dos-s/ <p style="color: grey"> Python recipe 476204 by <a href="/recipes/users/2712185/">Michael Soulier</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>One problem with ending all of your python scripts in .py is that you have to type the full name of the command. On Unix you can symlink to it with the shortened name, or wrap it in a bourne-shell script, or a shell alias. None of these solutions is particularly clean.</p> <p>On MS Windows, file extensions have much more meaning. In fact, there is an environment variable to control what extensions should be considered executables, to permit them to be run from name, without the extension. This is the PATHEXT environment variable. Add .PY to this, and all of your python scripts can be executed transparently.</p> Windows clipboard viewer (Python) 2004-12-04T12:50:56-08:00Georg Nelleshttp://code.activestate.com/recipes/users/2176948/http://code.activestate.com/recipes/355593-windows-clipboard-viewer/ <p style="color: grey"> Python recipe 355593 by <a href="/recipes/users/2176948/">Georg Nelles</a> (<a href="/recipes/tags/ui/">ui</a>). </p> <p>With the "SetClipboardViewer" function you can add a window to the chain of clipboard viewers. Whenever the content of the clipboard changes, a message is send to the clipboard viewer windows. A clipboard viewer window must process two messages and pass them to the next window in the chain. With a sample about hooking the window procedure of a wxPython Frame, I made up the following clipboard viewer.</p>