Popular recipes tagged "ui"http://code.activestate.com/recipes/tags/ui/2015-03-29T20:45:57-07:00ActiveState Code RecipesShortcut Utility (Python)
2015-03-29T20:45:57-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/579041-shortcut-utility/
<p style="color: grey">
Python
recipe 579041
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/desktop/">desktop</a>, <a href="/recipes/tags/directories/">directories</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/ui/">ui</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>I dislike filling my desktop with shortcut icons in Windows.
This code enables creating shortcuts in a CSV file.</p>
MultiListbox Tkinter widget (Python)
2014-01-03T19:23:48-08:00Juan Ramirezhttp://code.activestate.com/recipes/users/4174026/http://code.activestate.com/recipes/578805-multilistbox-tkinter-widget/
<p style="color: grey">
Python
recipe 578805
by <a href="/recipes/users/4174026/">Juan Ramirez</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>
Geometry class for Tkinter (Python)
2013-03-18T14:49:16-07:00David Cornehttp://code.activestate.com/recipes/users/4185735/http://code.activestate.com/recipes/578494-geometry-class-for-tkinter/
<p style="color: grey">
Python
recipe 578494
by <a href="/recipes/users/4185735/">David Corne</a>
(<a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/ui/">ui</a>).
Revision 2.
</p>
<p>An easily extensible class, inheriting from Canvas, which can be used to define geometry in a more mathematical way. So rather than specify a circle from 2 points you give a radius and a centre. These could have colour as a keyword argument but personally I always want to specify the colour.</p>
Accented Characters for Tkinter Widgets (Python)
2011-01-07T13:09:51-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/576950-accented-characters-for-tkinter-widgets/
<p style="color: grey">
Python
recipe 576950
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/ui/">ui</a>).
Revision 3.
</p>
<p>See <a href="http://code.activestate.com/recipes/286155/">Recipe 286155</a> for original code and author.</p>
<p>This module provides two standard Tkinter widgets, Entry and ScrolledText, modified for text editing with key bindings that allow entering accented letters, umlauts, etc.</p>
<p>Usage: To enter an accented character, press Ctrl-symbol, then press the character key. Example: to enter U with umlaut, press Ctrl-", U. For accent symbols that need shift, press Ctrl-Shift-symbol (for example, Ctrl-Shift-' if " is under Shift-').</p>
<p>Accent bindings are defined in the Diacritical.accent table. Not all accents exist on all letters. This is handled by gracefully falling back to the base letter.</p>
<p>Additional changes in default Tk key bindings: Ctrl-A is now select-all.</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>
Asyncore/asynchat in GTK (Python)
2008-03-17T13:51:05-07:00Niklas Janlerthttp://code.activestate.com/recipes/users/4132331/http://code.activestate.com/recipes/551774-asyncoreasynchat-in-gtk/
<p style="color: grey">
Python
recipe 551774
by <a href="/recipes/users/4132331/">Niklas Janlert</a>
(<a href="/recipes/tags/ui/">ui</a>).
</p>
<p>This recipe makes it possible to run asyncore/asynchat dispatchers in the GTK main thread.</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>
twizzler (Python)
2007-10-29T05:43:10-07:00alexander bakerhttp://code.activestate.com/recipes/users/4090201/http://code.activestate.com/recipes/534138-twizzler/
<p style="color: grey">
Python
recipe 534138
by <a href="/recipes/users/4090201/">alexander baker</a>
(<a href="/recipes/tags/ui/">ui</a>).
</p>
<p>Handy utility to get things moving on the command line.</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>
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>
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>
Downloading 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>
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>
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>
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>
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>
Determine the available desktop area (primary monitor) on Windows (Python)
2005-12-02T07:50:39-08:00Martin Denglerhttp://code.activestate.com/recipes/users/2688909/http://code.activestate.com/recipes/460508-determine-the-available-desktop-area-primary-monit/
<p style="color: grey">
Python
recipe 460508
by <a href="/recipes/users/2688909/">Martin Dengler</a>
(<a href="/recipes/tags/ui/">ui</a>).
</p>
<p>This recipe is the Python implementation of the SystemParametersInfoA() invocation required to retrieve the area that application windows can inhabit. On multi-monitor setups, the windows code returns the area on the primary monitor only. This recipe is the cleaned up version of this email post <a href="http://mail.python.org/pipermail/python-list/2003-May/162433.html" rel="nofollow">http://mail.python.org/pipermail/python-list/2003-May/162433.html</a> .</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>
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>
autosetup for simplified default values (Python)
2005-06-08T04:19:20-07:00Taro Ogawahttp://code.activestate.com/recipes/users/2476380/http://code.activestate.com/recipes/425119-autosetup-for-simplified-default-values/
<p style="color: grey">
Python
recipe 425119
by <a href="/recipes/users/2476380/">Taro Ogawa</a>
(<a href="/recipes/tags/ui/">ui</a>).
</p>
<p>If each class's __init__ is used to set default values, it requires that one use super() or explicit parentclass.__init__() calls . Such ugly boilerplate can be avoided with this recipe.</p>