Most viewed recipes tagged "frame"http://code.activestate.com/recipes/tags/frame/views/2017-05-16T18:15:44-07:00ActiveState Code RecipesFrame with border color for Tkinter (Python) 2017-04-17T11:25:02-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580735-frame-with-border-color-for-tkinter/ <p style="color: grey"> Python recipe 580735 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/border/">border</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). </p> <p>This trick show how to add a border color to frame. These are the important configurations:</p> <pre class="prettyprint"><code> highlightbackground="your border color here" highlightcolor="your border color here" highlightthickness="the border width" bd= 0 </code></pre> Scrolled Frame V2 (Python) 2017-05-06T18:54:47-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580797-scrolled-frame-v2/ <p style="color: grey"> Python recipe 580797 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/scrolling/">scrolling</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 4. </p> <p>This is another version of scrolled frame. It doesn't use Canvas. Instead it does the trick using place geometry manager.</p> <p>Based on these codes:</p> <ul> <li><p>https://github.com/alejandroautalan/pygubu/blob/master/pygubu/widgets/tkscrolledframe.py</p></li> <li><p>http://wiki.tcl.tk/9223 </p></li> </ul> <p>This is my other version of scrolled frame:</p> <p><a href="https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support/" rel="nofollow">https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support/</a></p> Tkinter frame with gradient (Python) 2017-03-11T03:43:56-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580761-tkinter-frame-with-gradient/ <p style="color: grey"> Python recipe 580761 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/canvas/">canvas</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/gradient/">gradient</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 4. </p> <p>Frame with linear gradient using PIL. </p> <p>It's also possible to make the same trick using tkinter PhotoImage.</p> <p><a href="http://stackoverflow.com/questions/10417524/why-is-photoimage-put-slow" rel="nofollow">http://stackoverflow.com/questions/10417524/why-is-photoimage-put-slow</a></p> <p>But PIL is more efficient:</p> <p><a href="https://groups.google.com/forum/#%21topic/comp.lang.python/nQ6YO-dTz10" rel="nofollow">https://groups.google.com/forum/#!topic/comp.lang.python/nQ6YO-dTz10</a></p> <p>Possible values for <strong>orient</strong> are: <em>VERTICAL</em>, <em>HORIZONTAL</em>. If <strong>orient</strong> is "vertical", then width is mandatory. If <strong>orient</strong> is "horizontal", then height is mandatory. If <strong>steps</strong> is <em>None</em>, then the gradient is composed of adjacent lines.</p> <p>One possible practical application of gradient frames are tool bars. Gradient guives a visual clue of when an area starts and when an area finish. </p> Scrolling frame with mouse wheel support (Python) 2017-05-16T18:15:44-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support/ <p style="color: grey"> Python recipe 580640 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/mousewheel/">mousewheel</a>, <a href="/recipes/tags/scrolling/">scrolling</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 26. </p> <p>Scrolling frame in Tkinter with mouse wheel support for different platforms.</p> A script evaluating PSNR metric of two YUV420 frames (Python) 2011-04-08T07:26:45-07:00Denis Gorodetskiyhttp://code.activestate.com/recipes/users/4177587/http://code.activestate.com/recipes/577645-a-script-evaluating-psnr-metric-of-two-yuv420-fram/ <p style="color: grey"> Python recipe 577645 by <a href="/recipes/users/4177587/">Denis Gorodetskiy</a> (<a href="/recipes/tags/comparison/">comparison</a>, <a href="/recipes/tags/difference/">difference</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/metric/">metric</a>, <a href="/recipes/tags/psnr/">psnr</a>, <a href="/recipes/tags/video/">video</a>, <a href="/recipes/tags/yuv/">yuv</a>). Revision 2. </p> <p>A script evaluating PSNR metric of two YUV420 frames <strong>usage: psnr.py filename1.yuv filename2.yuv frame_width frame_height</strong></p> <p>Alternatively if filename1 contains width and height in the form <strong>file-1200x1600.yuv</strong>, the script will extract width and height of a frame from the filename. Then usage even simplier: <strong>psnr.py filename1-1200x1600.yuv filename2.yuv</strong></p> Stacked frame for Tkinter (Python) 2017-04-13T18:20:26-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580784-stacked-frame-for-tkinter/ <p style="color: grey"> Python recipe 580784 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/animation/">animation</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/stacked/">stacked</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 2. </p> <p>I provide here a stacked frame widget with possibility to use animation for the transition.</p> Collpsible frame for Tkinter or Collapsible panel (Python) 2017-03-06T12:40:28-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580760-collpsible-frame-for-tkinter-or-collapsible-panel/ <p style="color: grey"> Python recipe 580760 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/collapse/">collapse</a>, <a href="/recipes/tags/collapsible/">collapsible</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/panel/">panel</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 6. </p> <p>Click on button and frame will collapse or expand.</p> <p>If you want to fit the frame to width of contents, call method "udpate_width()".</p> <p>Simple API:</p> <ul> <li>open()</li> <li>close()</li> <li>toggle()</li> <li>update_width()</li> </ul>