On Tue, 24 Apr 2018, Tim Roberts wrote:
You do not need to pass “self” as the first parameter. This is a Python
weirdness. When you write:
self.SetSizeHints( x, y, z )
that is the same as writing:
wx.Window.SetSizeHints( self, x, y, z )
so “self” is automatically passed as the first parameter.
Personally, I would call that a documentation bug, but it’s not one that
can be easily corrected. For now, just know that when you see “self” as
the first parameter, you can satisfy that by calling it as a method on the
object.
Tim,
Thanks for the lesson.
Removing the prepended ‘self.’ still leaves an issue with the function:
$ ./openEDMS.py Traceback (most recent call last):
File “./openEDMS.py”, line 292, in
top = MainFrame('openEDMS')
File “./openEDMS.py”, line 27, in init
SetSizeHints(self, minsize=wx.Size(300,200), maxSize=wx.Size(900,700), incSize=wx.Size(50,50))
NameError: name ‘SetSizeHints’ is not defined
My understanding is that SetSizeHints() is supposed to provide initial
minimal and maximal size for the main frame. I thought the initial frame
size was provided in the wx.Frame() init; e.g.,
def init(self, parent, id=wx.ID_ANY, title=“openEDMS”,
size=wx.Size(700,400), style=wx.DEFAULT_FRAME_STYLE|
wx.TAB_TRAVERSAL, name = "MainFrame"):
When I comment out that line there is neither an error traceback nor
display of the frame. There is no sizer in this class, only a status bar and
menus.
I wonder if this wxFormBuilder-generated code is missing something. I can
send the entire 9k module (as an attachment) to the list or you for review.
Rich
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.