How to create and use Wxapp application objects

Source: Internet
Author: User
The #!/usr/bin/python#-*-<coding=utf-8>-*-"" "Wxpython program is made up of two necessary objects: the    Application object, which is WX. The app or its sub-class object;    The top-Level window object, which is WX. Frame or its subclass object; Create a WX. Subclass of the app, you need to perform four steps:    1. Define this subclass;    2. Write a OnInit () method in the defined subclass    3. Create an instance of this subclass in your program;    4. Invoke the Mainloop () method of the application instance, which gives control of the program to Wxpython "" "Import Wxclass MyApp (WX. APP):    #这是第一步, the WX is defined. Sub-category of the app;    #编写OnInit () method    def OnInit (self): ""    creates a top-level window object in an Application object;    Call the Show method of the top-level window object to make it appear.    "" " frame = wx. Frame (id=-1,parent=none,pos=wx. Defaultposition,size=wx. DefaultSize)    frame. The Show ()    #OnInit () method must return a bool value.    Return true# step three, Instantiate Myappapp = MYAPP () #第四步, call Mainloop method App.mainloop ()

  

How to create and use Wxapp application objects

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.