{"id":89,"date":"2018-08-16T20:12:04","date_gmt":"2018-08-16T12:12:04","guid":{"rendered":"http:\/\/172.81.211.114\/?p=89"},"modified":"2021-08-13T09:48:35","modified_gmt":"2021-08-13T01:48:35","slug":"%e5%ae%9e%e7%8e%b0wxpython%e7%9a%84%e6%8b%96%e6%8b%bd%e4%b8%8a%e4%bc%a0%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/www.yinyubo.com\/?p=89","title":{"rendered":"\u5b9e\u73b0wxpython\u7684\u62d6\u62fd\u4e0a\u4f20\u529f\u80fd"},"content":{"rendered":"<p>\u5b9e\u73b0wxpython\u7684\u62d6\u62fd\u4e0a\u4f20\u529f\u80fd<br \/>\n1.\u4eceFileDropTarget\u7ee7\u627f<\/p>\n<pre class=\"lang:python decode:true  EnlighterJSRAW\" data-enlighter-language=\"golang\">\u00b7\u00b7\u00b7\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">class MyFileDropTarget(wx.FileDropTarget):\ndef init(self):\nwx.FileDropTarget.init(self)\ndef OnDropFiles(self, x, y, filepath):\n# file=os.path.basename(filepath[0])\n#\u5404\u79cd\u6587\u4ef6\u64cd\u4f5c\u4e4b\u7c7b\u7684\nreturn False<\/code> \u00b7\u00b7\u00b7<\/pre>\n<p>2.\u7ed9panel\u7ed1\u5b9a\u62d6\u62fd\u529f\u80fd<\/p>\n<pre class=\"lang:python decode:true \"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">    filedrop = MyFileDropTarget()\n    self.frame.panel_2.SetDropTarget(filedrop)\n<\/code><\/pre>\n<p>3.\u6ce8\u610f\u4e8b\u9879\uff1a<br \/>\n\u4e00\u6b21\u53ea\u80fd\u62d6\u62fd\u4e00\u4e2a\u6587\u4ef6\u4e0a\u53bb\uff0c\u5982\u679c\u4e00\u6b21\u62d6\u62fdA,B,C\u4e09\u4e2a\u6587\u4ef6\u3002\u6700\u540efilepath\u53ea\u80fd\u83b7\u53d6\u5230A\u6587\u4ef6\uff0cB\uff0cC\u4e22\u5931<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u73b0wxpython\u7684\u62d6\u62fd\u4e0a\u4f20\u529f\u80fd 1.\u4eceFileDropTarget\u7ee7\u627f \u00b7\u00b7\u00b7 class MyFileD [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[12],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-python","tag-wxpython"],"_links":{"self":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=89"}],"version-history":[{"count":1,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":960,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/89\/revisions\/960"}],"wp:attachment":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}