{"id":363,"date":"2013-02-06T11:29:31","date_gmt":"2013-02-06T11:29:31","guid":{"rendered":"http:\/\/www.jontrinder.com\/blog\/?p=363"},"modified":"2013-02-03T11:29:56","modified_gmt":"2013-02-03T11:29:56","slug":"wxglade-wxpython-and-custom-components","status":"publish","type":"post","link":"https:\/\/www.jontrinder.com\/blog\/?p=363","title":{"rendered":"wxGlade wxPython and custom components"},"content":{"rendered":"<p>A reminder to me of how to use custom components in a wxGlade Project.<br \/>\nI had a Panel which contained controls for a Matplotlib Project. The panel contained the plotting surface and some combo boxes to set parameters. I wanted to use this on multiple packages of a notebook to present different data views. This was a good canditiate for being re-used and subclassed. But how to to do that using wxGlade&#8230;.. <\/p>\n<p>This assumes a component based upon a Panel called a nineGraafTabPage_M<br \/>\nWhere the component is first used<br \/>\nProperties->Common->Class nineGraafTabPage_M<br \/>\nProperties->Common->BaseClasse(s) tick and set to wx.Panel (not NOT wxPanel)<\/p>\n<p><strong>How to reuse the Component<\/strong><\/p>\n<p>Now if we wish to reuse that panel somewhere else, for example on a notebook page. Then on the page you wish to use it. First of all inset a normal panel. Then<br \/>\nProperties->Common->Class NewNameWhatever<br \/>\nProperties->Common->BaseClasse(s) tick and set to nineGraafTabPage_M<br \/>\nThen also add on<br \/>\nProperties->Common->Code tick Extra code for this widget<br \/>\nand in the extra code section<br \/>\nfrom nineGraafTabPage_M import nineGraafTabPage_M<br \/>\n(important follow this with a carriage return)<br \/>\nThen click on the add properties button and set a property of id with a value of -1<\/p>\n<p><strong>General<\/strong><\/p>\n<p>In the application property page also tick<br \/>\nCode Generation Separate file for each class<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A reminder to me of how to use custom components in a wxGlade Project. I had a Panel which contained controls for a Matplotlib Project. The panel contained the plotting surface and some combo boxes to set parameters. I wanted &hellip; <a href=\"https:\/\/www.jontrinder.com\/blog\/?p=363\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[81,80,85,51],"tags":[50,52],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-coding","category-computing","category-python","category-wxglade","tag-python","tag-wxglade-2"],"_links":{"self":[{"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363"}],"version-history":[{"count":3,"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":366,"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions\/366"}],"wp:attachment":[{"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jontrinder.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}