Why python3 fails to run wx module saying my object has no attribute 'SetSizeHintsSz'?
<p>I am learning the use of wxPython. I have done some basic examples that work fine, but on this one it fails. It is a simple frame to square a number, prepared with the help of wxFormBuilder. I am running:
Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)] on Windows 8.1. The version of wxPython is Phoenix (3.0.3.dev1964+f780b21)</p>

<p>wxFormBuilder code "test_wx.py" is:</p>

<hr>

<pre><code># -*- coding: utf-8 -*- 

###########################################################################
## Python code generated with wxFormBuilder (version Jun 17 2015)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc

import gettext
_ = gettext.gettext

###########################################################################
## Class MyFrame1
###########################################################################

class MyFrame1 ( wx.Frame ):

    def __init__( self, parent ):
        wx.Frame.__init__ (self, parent, id = wx.ID_ANY, 
                           title = wx.EmptyString, 
                           pos = wx.DefaultPosition, 
                           size = wx.Size( 342,246 ), 
                           style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )

        bSizer1 = wx.BoxSizer( wx.VERTICAL )

        self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, 
                                           _(u"Give me a number"),
                                           wx.DefaultPosition, 
                                           wx.DefaultSize, wx.ALIGN_CENTRE )
        self.m_staticText1.Wrap( -1 )
        bSizer1.Add( self.m_staticText1, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )

        self.m_textCtrl1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer1.Add( self.m_textCtrl1, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )

        self.m_button1 = wx.Button( self, wx.ID_ANY, 
                                   _(u"Find the square!"), 
                                   wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer1.Add( self.m_button1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

        self.m_textCtrl2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, 
                                        wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE )
        bSizer1.Add( self.m_textCtrl2, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )


        self.SetSizer( bSizer1 )
        self.Layout()

        self.Centre( wx.BOTH )

        # Connect Events
        self.m_button1.Bind( wx.EVT_BUTTON, self.square)

    def __del__( self ):
        pass


    # Virtual event handlers, override them in your derived class
    def square( self, event ):
        event.Skip()
</code></pre>

<hr>

<p>Then I have this main script calling my demo:</p>

<hr>

<pre><code># -*- coding: utf-8 -*-
"""
Created on Sun Apr 10 12:42:45 2016

@author: Miguel
"""
# -*- coding: utf-8 -*- 

import wx

# Import the GUI as prepared by wxFormBuilder
import test_wx as demo

class CalcFrame(demo.MyFrame1): 
   def __init__(self,parent): 
      demo.MyFrame1.__init__(self,parent)

   def square(self,event): 
      num = int(self.m_textCtrl1.GetValue())
      self.m_textCtrl2.SetValue (str(num * num)) 

app = wx.App(False) 
frame = CalcFrame(None) 
frame.Show(True) 

# Start the GUI  
app.MainLoop()
wx.__version__
</code></pre>

<hr>

<p>The code is not running. The only clue I am getting is:</p>

<blockquote>
  <p>AttributeError: 'CalcFrame' object has no attribute 'SetSizeHintsSz'</p>
</blockquote>

<p>But that seems to me is available in the inherited class!!! Any way, I tried to include in the definition of CalcFrame the statement:</p>

<pre><code>        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
</code></pre>

<p>But didn't worked either. What might be wrong with this code?</p>