<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Python, TKinter, and GUI Canvas</title>
		<link>http://www.allegro.cc/forums/view/614776</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 07 Nov 2014 02:28:06 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m playing around with a GUI Canvas with TKinter in Python. I&#39;m very new to GUI design.</p><p>I can make a window instance, with a canvas. I can draw lines to it. But I can also draw rectangles and text to it.</p><p>Two questions:</p><p>1 - Is it possible to put a larger canvas than the window size, and add scroll bars? Something like Logisim. </p><p><span class="remote-thumbnail"><span class="json">{"name":"shot-2.7.0.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/0\/508ece8a61caef431e4b29dbcebf9d6a.png","w":471,"h":302,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/0\/508ece8a61caef431e4b29dbcebf9d6a"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/5/0/508ece8a61caef431e4b29dbcebf9d6a-240.jpg" alt="shot-2.7.0.png" width="240" height="153" /></span></p><p>2 - Drawing say, a rectangle, returns an item id. Does that mean I can hook a callback up to fire when someone clicks on one of those drawn rectangles? Or are canvas&#39;s just frame buffers for blindly drawing to? I&#39;m pretty sure in the case of TKinter, this is actually interactive. But I&#39;m not sure how to do a callback function.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Fri, 07 Nov 2014 01:43:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A canvas sounds like something you would draw to, not something you would add widgets too. Is that really what you want? Often you would have a regular window with buttons and text fields and stuff, and one of those widgets is a canvas that you draw graphics in.</p><p>I have no idea about the callback function, I don&#39;t think most GUI libs work like that, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Fri, 07 Nov 2014 01:50:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think I&#39;m making headway on #2. </p><p>A Canvas in TKinter is pretty dang cool. It&#39;s a dirty-rectangle stack of objects that all retain their &quot;object&quot; characteristics, as opposed to what I would presume a canvas would be--nothing more than a framebuffer meaning you lose drawing order and any object properties the second you blit. So what I mean is, you can easily change them in real-time, and they can respond to Mouse Over (inheriently) and Clicking events (with binding callbacks).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Fri, 07 Nov 2014 02:02:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah, ok. Neat.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Fri, 07 Nov 2014 02:28:06 +0000</pubDate>
	</item>
</rss>
