<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wxGlade &#8211; 编程技术记录</title>
	<atom:link href="https://blog.z6z8.cn/tag/wxglade/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.z6z8.cn</link>
	<description>世界你好!</description>
	<lastBuildDate>Wed, 23 Oct 2019 09:40:42 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>wxGlade : 生成的EVT_CLOSE关闭事件代码，运行崩溃</title>
		<link>https://blog.z6z8.cn/2019/10/23/wxglade-%e7%94%9f%e6%88%90%e7%9a%84evt_close%e5%85%b3%e9%97%ad%e4%ba%8b%e4%bb%b6%e4%bb%a3%e7%a0%81%ef%bc%8c%e8%bf%90%e8%a1%8c%e5%b4%a9%e6%ba%83/</link>
					<comments>https://blog.z6z8.cn/2019/10/23/wxglade-%e7%94%9f%e6%88%90%e7%9a%84evt_close%e5%85%b3%e9%97%ad%e4%ba%8b%e4%bb%b6%e4%bb%a3%e7%a0%81%ef%bc%8c%e8%bf%90%e8%a1%8c%e5%b4%a9%e6%ba%83/#respond</comments>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Wed, 23 Oct 2019 09:40:42 +0000</pubDate>
				<category><![CDATA[python]]></category>
		<category><![CDATA[wxGlade]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=525</guid>

					<description><![CDATA[我用wxGlade生成Python的UI代码，但添加监听EVT_CLOSE事件代码时，运行崩溃 Traceba [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>我用wxGlade生成Python的UI代码，但添加监听EVT_CLOSE事件代码时，运行崩溃</p>
<pre><code class="language-shell">Traceback (most recent call last):
  File "/Users/zxs.zl/Desktop/Yan/github/XcodeBuildPyUI/zlBuild/app.py", line 16, in OnInit
    self.frame = mainFrame(None, wx.ID_ANY, "")
  File "/Users/zxs.zl/Desktop/Yan/github/XcodeBuildPyUI/zlBuild/mainFrame.py", line 38, in __init__
    self.Bind(wx.EVT_CLOSE, self.onWindowClose, self.frame)
AttributeError: 'mainFrame' object has no attribute 'frame'</code></pre>
<p>生成的代码部分:</p>
<pre><code class="language-python">class mainFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: mainFrame.__init__
       部分代码如下

        self.Bind(wx.EVT_BUTTON, self.onClickBuildLibButton, self.buildLibButton)
        self.Bind(wx.EVT_CLOSE, self.onWindowClose, self.frame)
        # end wxGlade</code></pre>
<p>将生成的代码<code>self.frame</code>改为<code>self</code>，运行正常</p>
<pre><code class="language-python"># self.Bind(wx.EVT_CLOSE, self.onWindowClose, self.frame)
self.Bind(wx.EVT_CLOSE, self.onWindowClose, self)</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.z6z8.cn/2019/10/23/wxglade-%e7%94%9f%e6%88%90%e7%9a%84evt_close%e5%85%b3%e9%97%ad%e4%ba%8b%e4%bb%b6%e4%bb%a3%e7%a0%81%ef%bc%8c%e8%bf%90%e8%a1%8c%e5%b4%a9%e6%ba%83/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
