Latest recipes tagged "spinner"http://code.activestate.com/recipes/tags/spinner/new/2017-04-10T21:14:36-07:00ActiveState Code RecipesMetro Spinner for Tkinter (Python)
2017-04-10T21:14:36-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580777-metro-spinner-for-tkinter/
<p style="color: grey">
Python
recipe 580777
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/canvas/">canvas</a>, <a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/pil/">pil</a>, <a href="/recipes/tags/rotation/">rotation</a>, <a href="/recipes/tags/spinner/">spinner</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
</p>
<p>I create a rotating image class <em>RotatingIcon</em> inspired and based on this code:</p>
<p><a href="http://stackoverflow.com/questions/15736530/python-tkinter-rotate-image-animation" rel="nofollow">http://stackoverflow.com/questions/15736530/python-tkinter-rotate-image-animation</a></p>
<p>Features:</p>
<ul>
<li>Methods to stop and start the animation</li>
<li>The animation automically stops when the window is not mapped, and the animation continues when the window is mapped again</li>
<li>Time setting to control the speed of the animation</li>
<li>All the formats accepted for PIL could be used. XBM format is automatically converted to Tk Bitmap. The advantage of Bitmats is the possibility to change the color of the foreground.</li>
</ul>
<p>I added 6 different styles of spinners with different sizes.</p>
<p>I used fontawesome.io for the icon generation.</p>
<p>For more metro widgets see here:</p>
<p><a href="https://code.activestate.com/recipes/580729-metro-ui-tkinter/" rel="nofollow">https://code.activestate.com/recipes/580729-metro-ui-tkinter/</a></p>