Here is my attempt: I changed it to inherit from wx.Panel rather than wx.Frame. Then I made a different class which inherits from wx.Frame and attempted to instantiate my wx.Panel class, but the formatting got all weird. Everything is located on top of everything else.
How come that happened when all I did was make it a panel instead of a Frame and then instantiate it inside a Frame?
You can see from my attached code how similar the files are, I don’t understand what happened to the formatting and what I can do to make my widget more modular so that I can take the formatting you see in my first post (mainloop.py) and simply cascade it a few times inside a horizontal sizer or something like that.
Thanks in advance for your help.
Note: I have posted a question to stackoverflow about this as well: Find it here: python - Why does the formatting of my wxPython widget get fouled up? - Stack Overflow if you want rep for answering.
ETL_test.py (7.18 KB)
···
On Wednesday, November 14, 2012 10:59:34 PM UTC-5, Nick wrote:
Hello,
I have written some code based on the example program mainloop.py which almost completes my desired functionality. It creates a status widget for my device and monitors the serial port for updates to the device’s status.
What I’m wondering is how do I turn the class ETL_test which inherits from wx.Frame into a custom widget.
The end goal is to make another class called overall_test or whatever which instantiates 3 of my ETL_test class widgets into a single horizontal sizer and then buts a few additional buttons on the bottom. I’m just very confused about how I can create 3 of my classes in a single frame??
I have attached my code for your reference. Any feedback is welcome