Coming back up to speed with wxPython4

It's been several years since I last used wxPython and I've forgotten much
that I knew then. My new application uses Python3 and wxPython-4.x. I used
wxFormBuilder for the framework of the classes needed but the python code it
emits goes only so far. I want to re-learn how to correctly use
wxPython-4.x.

   There are several tutorials available, but the ones I've found are a few
to many years out of date, and all for Python2 and wxPython-3.0.2.0 or
earlier, including on wxPyWiki.

   I would appreciate suggestions to current tutorials (that augment the
APIs) for the new wxPython.

TIA,

Rich

Forgot to mention that I'm making good use of the demo code, too, but
still have questions about syntax and overall structure within a class.

Rich

···

On Sat, 14 Apr 2018, Rich Shepard wrote:

There are several tutorials available, but the ones I've found are a few
to many years out of date, and all for Python2 and wxPython-3.0.2.0 or
earlier, including on wxPyWiki.

I second his request. Are there any books, as well that might be good out there to?

···

-----Original Message-----
From: wxpython-users@googlegroups.com <wxpython-users@googlegroups.com> On Behalf Of Rich Shepard
Sent: Saturday, April 14, 2018 11:01 AM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] Coming back up to speed with wxPython4

On Sat, 14 Apr 2018, Rich Shepard wrote:

There are several tutorials available, but the ones I've found are a
few to many years out of date, and all for Python2 and
wxPython-3.0.2.0 or earlier, including on wxPyWiki.

   Forgot to mention that I'm making good use of the demo code, too, but still have questions about syntax and overall structure within a class.

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.

I think this is still valid:

https://wiki.wxpython.org/wxPython%20Style%20Guide

But I’m sure it could use a refresh.

Contributions accepted!

-CHB

···

On Apr 14, 2018, at 12:13 PM, juanhernandez98@gmail.com juanhernandez98@gmail.com wrote:

I second his request. Are there any books, as well that might be good out there to?

-----Original Message-----
From: wxpython-users@googlegroups.com wxpython-users@googlegroups.com On Behalf Of Rich Shepard
Sent: Saturday, April 14, 2018 11:01 AM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] Coming back up to speed with wxPython4

On Sat, 14 Apr 2018, Rich Shepard wrote:

There are several tutorials available, but the ones I’ve found are a
few to many years out of date, and all for Python2 and
wxPython-3.0.2.0 or earlier, including on wxPyWiki.

Forgot to mention that I’m making good use of the demo code, too, but still have questions about syntax and overall structure within a class.

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.


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.

Chris,

   Thanks. I'll re-read that style guide, but still look for a tutorial for
wxPython4 that's more comprehensive. The style guide has answered a couple
of questions I had.

Regards,

Rich

···

On Sat, 14 Apr 2018, Chris Barker - NOAA Federal wrote:

I think this is still valid:
https://wiki.wxpython.org/wxPython%20Style%20Guide
But I’m sure it could use a refresh.

Most of the tutorials on my blog work with wxPython 4. If you all have a list of questions maybe I could put together a new series of tutorials.

Mike

···

On Sat, Apr 14, 2018, 4:06 PM Rich Shepard rshepard@appl-ecosys.com wrote:

On Sat, 14 Apr 2018, Chris Barker - NOAA Federal wrote:

I think this is still valid:

https://wiki.wxpython.org/wxPython%20Style%20Guide

But I’m sure it could use a refresh.

Chris,

Thanks. I’ll re-read that style guide, but still look for a tutorial for

wxPython4 that’s more comprehensive. The style guide has answered a couple

of questions I had.

Regards,

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.

Mike,

   I apologize for forgetting about your excellent writings. While I have a
bunch of questions I'm sure the answers are readily available.

   I want to be more 'correct' (and pythonic) with this new project. Once I
have a basic working application I'll put it on sourceforge so if others
want to improve or enhance it they can. I'd use git hub but they want a
monthly fee and I'm neither on salary nor in the software business so I
prefer a no-cost home for it.

Regards,

Rich

···

On Sun, 15 Apr 2018, Mike Driscoll wrote:

Most of the tutorials on my blog work with wxPython 4. If you all have a
list of questions maybe I could put together a new series of tutorials.

I use Github all the time. They don’t charge for it except for businesses. Python itself is on there after all.

Mike

···

On Sun, Apr 15, 2018, 10:15 AM Rich Shepard rshepard@appl-ecosys.com wrote:

On Sun, 15 Apr 2018, Mike Driscoll wrote:

Most of the tutorials on my blog work with wxPython 4. If you all have a

list of questions maybe I could put together a new series of tutorials.

Mike,

I apologize for forgetting about your excellent writings. While I have a

bunch of questions I’m sure the answers are readily available.

I want to be more ‘correct’ (and pythonic) with this new project. Once I

have a basic working application I’ll put it on sourceforge so if others

want to improve or enhance it they can. I’d use git hub but they want a

monthly fee and I’m neither on salary nor in the software business so I

prefer a no-cost home for it.

Regards,

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.

Mike,

   Oh. Well, I run a sole-practitioner professional services consultancy and
the tool I'm writing will help my clients and others. But, my business is
not writing software so I suppose I could qualify as a no-fee user.

Thanks,

Rich

···

On Sun, 15 Apr 2018, Mike Driscoll wrote:

I use Github all the time. They don't charge for it except for businesses.
Python itself is on there after all.

Oh. Well, I run a sole-practitioner professional services consultancy and

the tool I'm writing will help my clients and others. But, my business is
not writing software so I suppose I could qualify as a no-fee user.

OT, but gitHub doesn't care if you make money writing software or not -- if
your repo is open source, then you can use it for free.

If you want to restrict access to your code, then you need to pay for the
service.

-CHB

···

On Sun, Apr 15, 2018 at 9:08 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

Thanks,

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.

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Aha! That really clarifies the situation. Yes, it will be open source.

Thanks, Chris,

Rich

···

On Mon, 16 Apr 2018, Chris Barker wrote:

OT, but gitHub doesn't care if you make money writing software or not --
if your repo is open source, then you can use it for free.

If you want to restrict access to your code, then you need to pay for the
service.

I apologize for forgetting about your excellent writings. While I have a

bunch of questions I’m sure the answers are readily available.

I want to be more ‘correct’ (and pythonic) with this new project. Once I

have a basic working application I’ll put it on sourceforge so if others

want to improve or enhance it they can. I’d use git hub but they want a

monthly fee and I’m neither on salary nor in the software business so I

prefer a no-cost home for it.

I still think it might be worth asking the questions in case it might help others on the list.

Mike

Mike, et al.:

   Here's one question on handling wx.Choices() objects.

   wxFormBuilder produced this code:

     self.ffg = wx.Choice(self, wx.ID_ANY, choices = ffgChoices, 0)
     self.ffg.SetSelection(0)

while the 4.0.1 demo (Choices.py) binds the event to the choice:

     self.ch = wx.Choice(self, -1, (100, 50), choices = sampleList)
     self.Bind(wx.EVT_CHOICE, self.EvtChoice, self.ch)

   Although SetSelection is a wx.Choice() method it seems inappropriate
becasue there's nothing following about getting that selection and passing
it to a method for processing.

   My inclination is to remove the wxFB line and replace it with the demo
line. Is this correct?

Rich

···

On Tue, 17 Apr 2018, Mike Driscoll wrote:

I still think it might be worth asking the questions in case it might help
others on the list.

wxFormBuilder still not create code for Phoenix and have many errors yet, all the time a need to compare that code with the demo and replace it when I needed. Menus is a big troubble…

···

2018-04-18 15:48 GMT-05:00 Rich Shepard rshepard@appl-ecosys.com:

I still think it might be worth asking the questions in case it might help

others on the list.
On Tue, 17 Apr 2018, Mike Driscoll wrote:

Mike, et al.:

Here’s one question on handling wx.Choices() objects.

wxFormBuilder produced this code:

self.ffg = wx.Choice(self, wx.ID_ANY, choices = ffgChoices, 0)

self.ffg.SetSelection(0)

while the 4.0.1 demo (Choices.py) binds the event to the choice:

[self.ch](http://self.ch) = wx.Choice(self, -1, (100, 50), choices = sampleList)

self.Bind(wx.EVT_CHOICE, self.EvtChoice, [self.ch](http://self.ch))

Although SetSelection is a wx.Choice() method it seems inappropriate

becasue there’s nothing following about getting that selection and passing

it to a method for processing.

My inclination is to remove the wxFB line and replace it with the demo

line. Is this correct?

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.

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

Mario,

   Thank you for confirming what I thought was happening. When I looked at
the wxFormBuilder output I could not relate it to what I expected and
decided to switch back to hand-coding in emacs.

   Now I'll go through each of the 6 modules and make them compatible with
wxPython-4.x.

Best regards,

Rich

···

On Wed, 18 Apr 2018, Mario Lacunza wrote:

wxFormBuilder still not create code for Phoenix and have many errors yet,
all the time a need to compare that code with the demo and replace it when
I needed. Menus is a big troubble...

Rich Shepard wrote:

Here's one question on handling wx.Choices() objects.

wxFormBuilder produced this code:

self\.ffg = wx\.Choice\(self, wx\.ID\_ANY, choices = ffgChoices, 0\)
self\.ffg\.SetSelection\(0\)

...
Although SetSelection is a wx.Choice() method it seems inappropriate
becasue there's nothing following about getting that selection and
passing
it to a method for processing.

That's just setting the default selection. Why is that inappropriate?
You're always going to need to add a binding to handle the selection
events. wxFormBuilder can add the event handlers.

Maybe I just don't understand your objection.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Tim,

   It's not an objection but a lack of understanding among 'classic,'
'phoenix,' and FB. I need to learn wxPython-4.x and SQLAlchemy to build this
tool.

   BTW, I've found so many discrepancies between wxFormBuilder and the 4.0.1
demo code that I've removed the former and am going line-by-line to make my
classes correspond with the demos.

   Below is my design for the application. I am completely open to advise and
suggestions by all of you who spend your days developing applications with
wxPython, and I am uncertain of which class methods I should be using to
make the application work the way I've designed it. BTW, if the design
should be modified I'll certainly do this.

   The application design:

The application has 6 modules: main, and one for each data catagory.

The main module has the main_frame with menus (File, Add, Edit, View,
Reports, Help), a status bar and a tabbed notebook, one tab for each data
type.

Each data type module has two classes: a grid for displaying data for that
category retrieved from the database back end and a dialog box to add new
data and modify existing data.

Initially, each grid has zero rows and columns with the attribute names for
that database table/SQLAlchemy model. As data are added they are displayed
by adding a row to the grid.

Each dialog has text entry, choice, and spinner widgets. I need to collect
user data from each widget when the user presses the 'Save' button and pass
those value to SQLAlchemy in a method (as a dictionary) for insertion in the
backend database table.

Thanks,

Rich

···

On Thu, 19 Apr 2018, Tim Roberts wrote:

That's just setting the default selection. Why is that inappropriate?
You're always going to need to add a binding to handle the selection
events. wxFormBuilder can add the event handlers.

Maybe I just don't understand your objection.

Oops! That should be 'advice' and not 'advise.'

Rich

···

On Thu, 19 Apr 2018, Rich Shepard wrote:

Below is my design for the application. I am completely open to advise and