Traceback (most recent call last):
File "./openEDMS.py", line 274, in <module>
frame_1 = MainFrame(None)
File "./openEDMS.py", line 28, in __init__
self.SetSizeHints(self)
TypeError: TopLevelWindow.SetSizeHints(): arguments did not match any overloaded call:
overload 1: argument 1 has unexpected type 'MainFrame'
overload 2: argument 1 has unexpected type 'MainFrame'
When I comment out self.SetSizeHints(self) trying to invoke the package
results in a segfault:
$ ./openEDMS.py Segmentation fault
Looking for wxPython4.x docs on this wx.TopLevelWindow tells me,
"SetSizeHints Allows specification of minimum and maximum window sizes,
and window size increments." and I have no idea what values to put in there.
I'm not finding an example in the demos and would like a pointer to an
example.
Progess has been made: the problem was the structure of the __main__
method at the bottom of the module. Changing it to:
if __name__ == "__main__":
edms = wx.App(redirect=True)
top = Frame('openEDMS')
top = Show()
edms.MainLoop()
eliminates the SetSizeHints() error and the segfault. However, while the
main module runs without error there's no display on the monitor. Time to
run winpdb, unless someone has a preferred alternative.
Rich
···
On Mon, 23 Apr 2018, Rich Shepard wrote:
Looking for wxPython4.x docs on this wx.TopLevelWindow tells me,
"SetSizeHints Allows specification of minimum and maximum window sizes,
and window size increments." and I have no idea what values to put in
there. I'm not finding an example in the demos and would like a pointer to
an example.
if __name__ == "__main__":
edms = wx.App(redirect=True)
top = MainFrame('openEDMS')
top = Show()
edms.MainLoop()
When I run this from a virtual terminal nothing happens; the bash prompt
is displayed.
If I change the paramter of wx.App() to 0 then I get the error for
self.SetSizeHints(self):
$ ./openEDMS.py Traceback (most recent call last):
File "./openEDMS.py", line 274, in <module>
top = MainFrame('openEDMS')
File "./openEDMS.py", line 28, in __init__
self.SetSizeHints(self)
TypeError: TopLevelWindow.SetSizeHints(): arguments did not match any overloaded call:
overload 1: argument 1 has unexpected type 'MainFrame'
overload 2: argument 1 has unexpected type 'MainFrame'
Commenting out 'self.SetSizeHints(self)' throws a different error.
I'm thoroughly confused and not finding information on the web that
explains what I've done incorrectly.
Calling the base class init with no parameters initializes the C++ class but does not create and initialize the UI widget. You either need to call the other version of init with all the parameters, or call the frame’s Create method if you want to delay it until later for some reason.
···
On Monday, April 23, 2018 at 11:40:44 AM UTC-7, Rich wrote:
Thank you for pointing out what I was missing, and why it needs
correcting. Starting with this project I want to really understand why
wxPython needs to be written a certain way and not just copy it from another
source.
The module containing wx.Frame was generated by wxFormBuilder. I keep
finding more things it does incorrectly; e.g., using tabs for block spacing
rather than spaces. I had to globally search and replace tabs with 4 spaces
on each file it produced. So much for 'rapid application development'. Feh!
Back to writing each line in emacs.
Very much appreciated,
Rich
···
On Mon, 23 Apr 2018, Robin Dunn wrote:
Calling the base class __init__ with no parameters initializes the C++
class but does not create and initialize the UI widget. You either need to
call the other version of __init__ with all the parameters, or call the
frame's Create method if you want to delay it until later for some reason.
Calling the base class __init__ with no parameters initializes the C++
class but does not create and initialize the UI widget. You either
need to
call the other version of __init__ with all the parameters, or call the
frame's Create method if you want to delay it until later for some
reason.
Robin,
Thank you for pointing out what I was missing, and why it needs
correcting. Starting with this project I want to really understand why
wxPython needs to be written a certain way and not just copy it from
another
source.
The module containing wx.Frame was generated by wxFormBuilder. I keep
finding more things it does incorrectly; e.g., using tabs for block spacing
rather than spaces. I had to globally search and replace tabs with 4 spaces
on each file it produced. So much for 'rapid application development'. Feh!
Back to writing each line in emacs.
Very much appreciated,
Rich
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.
---
This email has been checked for viruses by AVG.
I've been using emacs for Python (and almost all other writing) for about
20 years now and it does syntax highlighting and proper formatting based on
the .py file extension.
Many years ago I read someone's description of emacs as the only editor
with it's own operating system, and another's description as an editor which
includes everything, including the kitchen sink.
A friend who used to work at Sharp Labs used emacs exclusively, including
e-mail and web browsing. And the flame wars between users of emacs and vi
died out long ago, to everyone's relief.
On the topic of Python IDEs, long ago I tried Glade and a couple of
others. Gave them up. They all emitted code that looked different from the
PEP and I had to redo most of it so there was no advantage --- for me --- to
use any of them. Sadly, wxFormBuilder is equally unsatisfactory.