Where does the close method of Wx. Frame inherit from?

Source: Internet
Author: User
#  /Usr/bin/Python  #  -*-<Coding = UTF-8> -*-  """  This example shows how to add objects to a framework. The example in section 2.6 of wxpython  """  Import  WX  Class  Insertframe (wx. Frame ):  Def   _ Init __  (Self, parent, ID): WX. Frame.  _ Init __ (Self, parent, ID, Title ="  Frame with button  " , Size = (300,100 ))  #  Create a panel control in Wx. Frame. Panel = Wx. Panel (Self)  #  Create a button control in Wx. Panel Button = wx. Button (panel, label = "  Close  " , Pos = (), size = (50, 50 ))  # The click event of the BIND button. Note that the Wx. frame is bound to the oncloseme event, rather than other objects.  Self. BIND (wx. evt_button, self. oncloseme, button)  #  Close event of the binding window  Self. BIND (wx. evt_close, self. onclosewindow)  Def  Oncloseme (self, event ):  # Where does the close method come from? after reading the API, wx. frame does not seem to have the close () method?  Self. Close (true)  Print Self. Close. _ Doc __  """ Close (self, bool force = false)-> bool this function simply generates a evt_close event whose handler usually tries to close the window. it doesn' t close the window itself, however. if force is false (the default) then the window's close handler will be allowed to veto the destruction of the window.  """      Def  Onclosewindow (self, event ):  # The destroy () method is available only for WX. App. Why can wx. Frame be called?  Self. Destroy ()  Print Self. Destroy. _ Doc __  """ Destroy (Self)-> bool destroys the window safely. frames and dialogs are not destroyed immediately when this function is called -- they are added to a list of windows to be deleted on idle time, when all the windows's events have been processed. this prevents problems with events being sent to non-existent windows. returns true if the window has either been successfully deleted, or it has been added to the list of Windows pending Real deletion.  """     If   _ Name __ = "  _ Main __  "  : App =Wx. pysimpleapp () Frame = Insertframe (parent = none, id =-1 ) Frame. Show () app. mainloop () 

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.