<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Extending our PyGTK Application</title>
	<atom:link href="http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/</link>
	<description>one man's journey into python...</description>
	<pubDate>Sun, 06 Jul 2008 23:33:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: selsine</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-49562</link>
		<dc:creator>selsine</dc:creator>
		<pubDate>Mon, 22 Oct 2007 13:33:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-49562</guid>
		<description>Dave,

Not that I know of, although I have seen Python scripts out there that do it for you.

Joono,

What sort of validation are you looking for?</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Not that I know of, although I have seen Python scripts out there that do it for you.</p>
<p>Joono,</p>
<p>What sort of validation are you looking for?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joono</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-49539</link>
		<dc:creator>Joono</dc:creator>
		<pubDate>Mon, 22 Oct 2007 06:38:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-49539</guid>
		<description>i want some help on Validation in this example
I tried some but none of them works....</description>
		<content:encoded><![CDATA[<p>i want some help on Validation in this example<br />
I tried some but none of them works&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave H</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-48448</link>
		<dc:creator>Dave H</dc:creator>
		<pubDate>Tue, 09 Oct 2007 19:34:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-48448</guid>
		<description>Excellent!  I'm new to Linux (Ubuntu) and your tutorials are exactly what I needed to get a conceptual and practical grip on GUI coding.  

It seems to me there is a lot of code blocks that could be auto-generated for all the default events and such.  Are there any developments 'out there' that pull Python and Glade together into one development environment (IDE)?   

Keep up the great work, I'll be back!</description>
		<content:encoded><![CDATA[<p>Excellent!  I&#8217;m new to Linux (Ubuntu) and your tutorials are exactly what I needed to get a conceptual and practical grip on GUI coding.  </p>
<p>It seems to me there is a lot of code blocks that could be auto-generated for all the default events and such.  Are there any developments &#8216;out there&#8217; that pull Python and Glade together into one development environment (IDE)?   </p>
<p>Keep up the great work, I&#8217;ll be back!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: selsine</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-47668</link>
		<dc:creator>selsine</dc:creator>
		<pubDate>Tue, 02 Oct 2007 13:55:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-47668</guid>
		<description>Hi Matt,

Thanks for the semi-colon catch! I've spent way too much time using C++!

Also thanks for the kind words!</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>Thanks for the semi-colon catch! I&#8217;ve spent way too much time using C++!</p>
<p>Also thanks for the kind words!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: selsine</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-47667</link>
		<dc:creator>selsine</dc:creator>
		<pubDate>Tue, 02 Oct 2007 13:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-47667</guid>
		<description>Hi Steve,

Thanks for the information and the great tip! If you want to take a loot at more Tree processing take a look at the &lt;a href="http://www.learningpython.com/2007/09/23/pylan-a-gtd-todo-application-written-in-python-and-pygtk-part-four-context-menus/" rel="nofollow"&gt;PyLan tutorials&lt;/a&gt; as I do a little bit more in there.

For plotting you might want to take a look at &lt;a href="http://matplotlib.sourceforge.net/" rel="nofollow"&gt;Matplotlib&lt;/a&gt;

I will take a look into the rubber banding, that's an interesting feature that I have not looked into yet.</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>Thanks for the information and the great tip! If you want to take a loot at more Tree processing take a look at the <a href="http://www.learningpython.com/2007/09/23/pylan-a-gtd-todo-application-written-in-python-and-pygtk-part-four-context-menus/" rel="nofollow">PyLan tutorials</a> as I do a little bit more in there.</p>
<p>For plotting you might want to take a look at <a href="http://matplotlib.sourceforge.net/" rel="nofollow">Matplotlib</a></p>
<p>I will take a look into the rubber banding, that&#8217;s an interesting feature that I have not looked into yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Nichols</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-47514</link>
		<dc:creator>Matt Nichols</dc:creator>
		<pubDate>Mon, 01 Oct 2007 02:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-47514</guid>
		<description>Hey, I really enjoyed this tutorial, and learned a lot. Thanks!
A few suggestions:
-Look for semicolons at the end of some lines, I think some ended up in your code
-Remember to remind people to import the "shelve" and "os" modules
-Keep blogging! You are great, dude.</description>
		<content:encoded><![CDATA[<p>Hey, I really enjoyed this tutorial, and learned a lot. Thanks!<br />
A few suggestions:<br />
-Look for semicolons at the end of some lines, I think some ended up in your code<br />
-Remember to remind people to import the &#8220;shelve&#8221; and &#8220;os&#8221; modules<br />
-Keep blogging! You are great, dude.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-47324</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 28 Sep 2007 16:38:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-47324</guid>
		<description>Great tutorials! I got up and going and extending the examples in very short order.

I found that I wanted to double-click the entries to edit them.

To do it, I added a handler for the row_activated event using glade (which was just what I wanted) and called the event on_EditRow. Turns out that row_activated gives more arguments that specify what was selected (oddly enough), but I wasn't sure how to use them so I just wrapped them up and called your existing on_EditWine function.

So I added the handler to the dictionary with a

"on_EditRow" : self.on_EditRow

in the middle there, then wrote the wrapper,

def on_EditRow(self, widget, path, column):
    """ Called when the user double-clicks a row """
    self.on_EditWine(widget)

Since the double-clicked row is also selected, it's just a little extra work that could be avoided in the on_EditWine function but it doesn't hurt (I don't think).

Anyway, keep up the good tutorials. I just found your site and have been learning a bunch.

(Any thoughts on a widget I could embed that would do 2-D plots of data? Ideally, I just pass it a couple of data sets and it does all the hard work of plotting.)

(One more, how about a tutorial about rubber-banding items? It's integral to the GUI experience and used extensively, but there seem to be a fair amount of complexity in both the graphical part and using the bounding box for item selection that I've never seen one.)</description>
		<content:encoded><![CDATA[<p>Great tutorials! I got up and going and extending the examples in very short order.</p>
<p>I found that I wanted to double-click the entries to edit them.</p>
<p>To do it, I added a handler for the row_activated event using glade (which was just what I wanted) and called the event on_EditRow. Turns out that row_activated gives more arguments that specify what was selected (oddly enough), but I wasn&#8217;t sure how to use them so I just wrapped them up and called your existing on_EditWine function.</p>
<p>So I added the handler to the dictionary with a</p>
<p>&#8220;on_EditRow&#8221; : self.on_EditRow</p>
<p>in the middle there, then wrote the wrapper,</p>
<p>def on_EditRow(self, widget, path, column):<br />
    &#8220;&#8221;" Called when the user double-clicks a row &#8220;&#8221;"<br />
    self.on_EditWine(widget)</p>
<p>Since the double-clicked row is also selected, it&#8217;s just a little extra work that could be avoided in the on_EditWine function but it doesn&#8217;t hurt (I don&#8217;t think).</p>
<p>Anyway, keep up the good tutorials. I just found your site and have been learning a bunch.</p>
<p>(Any thoughts on a widget I could embed that would do 2-D plots of data? Ideally, I just pass it a couple of data sets and it does all the hard work of plotting.)</p>
<p>(One more, how about a tutorial about rubber-banding items? It&#8217;s integral to the GUI experience and used extensively, but there seem to be a fair amount of complexity in both the graphical part and using the bounding box for item selection that I&#8217;ve never seen one.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: selsine</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-31504</link>
		<dc:creator>selsine</dc:creator>
		<pubDate>Mon, 04 Jun 2007 23:30:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-31504</guid>
		<description>Hi David,

Thanks for the great catch!

I figured out the problem, it's what I've heard referred to as a "sticky-variable" problem in the past, which means that it's simply a code error.

The problem is in these lines in the windDialog class:

[code lang="python"]
#They have passed a wine object
self.wine = wine
[/code]

What this does is set self.wine to be a reference to wine (a shallow copy), so when we change self.wine  we are also changing wine itself.  So even if we cancel the operation, wine (which is stored in the list) gets changed.

To fix this you can use the following code instead of the above lines:

[code lang="python"]
#They have passed a wine object
self.wine = Wine(wine.wine
					, wine.winery
					, wine.grape
					, wine.year)
[/code]

This will create a copy of the wine object in self.wine, and stop the cancel problem from happening.</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Thanks for the great catch!</p>
<p>I figured out the problem, it&#8217;s what I&#8217;ve heard referred to as a &#8220;sticky-variable&#8221; problem in the past, which means that it&#8217;s simply a code error.</p>
<p>The problem is in these lines in the windDialog class:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-comment">#They have passed a wine object
</span><span class="hl-identifier">self</span><span class="hl-default">.</span><span class="hl-identifier">wine</span><span class="hl-default"> = </span><span class="hl-identifier">wine</span></pre></div></div>
<p>What this does is set self.wine to be a reference to wine (a shallow copy), so when we change self.wine  we are also changing wine itself.  So even if we cancel the operation, wine (which is stored in the list) gets changed.</p>
<p>To fix this you can use the following code instead of the above lines:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-comment">#They have passed a wine object
</span><span class="hl-identifier">self</span><span class="hl-default">.</span><span class="hl-identifier">wine</span><span class="hl-default"> = </span><span class="hl-identifier">Wine</span><span class="hl-brackets">(</span><span class="hl-identifier">wine</span><span class="hl-code">.</span><span class="hl-identifier">wine</span><span class="hl-code">
					, </span><span class="hl-identifier">wine</span><span class="hl-code">.</span><span class="hl-identifier">winery</span><span class="hl-code">
					, </span><span class="hl-identifier">wine</span><span class="hl-code">.</span><span class="hl-identifier">grape</span><span class="hl-code">
					, </span><span class="hl-identifier">wine</span><span class="hl-code">.</span><span class="hl-identifier">year</span><span class="hl-brackets">)</span></pre></div></div>
<p>This will create a copy of the wine object in self.wine, and stop the cancel problem from happening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-31483</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 04 Jun 2007 20:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-31483</guid>
		<description>There is a bug
I create an entry
I edit it,make change on a field, but I click on the cancel button
The entry is not modified in the view
but if I edit it again, the changes I have canceled appear !!!</description>
		<content:encoded><![CDATA[<p>There is a bug<br />
I create an entry<br />
I edit it,make change on a field, but I click on the cancel button<br />
The entry is not modified in the view<br />
but if I edit it again, the changes I have canceled appear !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: selsine</title>
		<link>http://www.learningpython.com/2006/09/02/extending-our-pygtk-application/#comment-17322</link>
		<dc:creator>selsine</dc:creator>
		<pubDate>Mon, 09 Apr 2007 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=39#comment-17322</guid>
		<description>Lord Taran, keep up the great work.  Please be sure to let the people at pyGTK.org know about your translations!</description>
		<content:encoded><![CDATA[<p>Lord Taran, keep up the great work.  Please be sure to let the people at pyGTK.org know about your translations!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
