Wxpython use cases for framework classes and Panel classes

Source: Internet
Author: User
This paper describes the use of Wxpython Framework class and Panel class, and share it for everyone's reference. The specific analysis is as follows:

The implementation code is as follows:

Import WX   class MyApp (WX. APP):  #自定义应用程序类, call a custom framework class in Class   def OnInit (self):     self.frame = MyFrame (None, title = "My Main frame Jb51.net") C4/>self. Settopwindow (self.frame)     self.frame.Show ()      return True  class MyFrame (WX. FRAME): #自定义框架类, the custom framework class has a panel attribute   def __init__ (self, parent, Id=wx.id_any, title= ""):     super (MyFrame, Auto) . __init__ (parent, ID, title)         # Attributes      self.panel = wx. Panel (self)  if __name__ = = "__main__":   app = MyApp ()   app. Mainloop ()

The program works as shown in the following:

Hopefully this article will help you with Python programming.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.