How is the state of progress on migration to wxpython 4?

Hi,

I tried the latest version (on master branch) of Builder with winpython 3.6.1 and wxpython 4.0.0b1. The Builder window looked ok, but I counldn’t run experiment by pressing “Run Experiment” button. No error message was shown.

I read app/builder/builder.py and guessed flags passed to wx.Execute() were imcompatible with wxphtyon 4, but I’m not sure. How is the state of progress on migration to wxpython 4? Is there anyone who can run Builder experiment on Python 3 and wxpython 4?

On my mac the launching of the studies is working fine (although I’ve just fixed an issue that the stdout/stderror was not being converted correctly to unicode in wx4). I’ll check on windows myself

Removing the EXEC_NOHIDE flag is one step closer. That allows the experiment to run but it doesn’t terminate correctly.

That is fixed in https://github.com/psychopy/psychopy/pull/1613/commits/60fe6064a77d96448619d16d3c4e61770520112c

Thanks.
Experiment doesn’t terminate in my setup (Japanese Win10, winpython 3.6.1 x64), too.
I’ll investigate the issue.

By the way, is PsychoPy’s splash closed automatically in Python3/wxpython4 ?
In my setup, splash is not closed until mouse-clicked on it.

I extracted code for creating splash from app/_psychpyapp.py and wrote a script that just do showing splash (see attached). In this case, splash is closed automatically as expected. It seems that something done by PsychoPy application may prevent closing splash.
splashtest.py (1.0 KB)

I’d noticed the splash issue as well. Imagine this is related to wx4 (rather than PY3) and isn’t a problem on mac

Hmm… I was worried that this phenomenon was due to my installation failure, but it seems to be a problem of wxpython 4 for Windows. I’ll continue investigating these issues.

Hi Jon,

I read document of wxpython-phoenix and found that state of toolbar items should be changed by wx.ToolBar.EnableTool(). Rewriting app/builder/builder.py to use wx.ToolBar.EnableTool(), Builder experiment seems to terminate correctly (Exactly to say, the problem was not termination of experiment but updating satatus of Run/Stop buttons). I created feature-wx4 branch in my repository and pushed this fix.

Regarding the issue of EXEC_HOHIDE flag, wx.EXEC_HIDE_CONSOLE didn’t work in my environment. Instead, wx.EXEC_SHOW_CONSOLE works fine. I’d appreciate if you could test wx.EXEC_SHOW_CONSOLE in your environment.

Great work. I had noticed that the buttons weren’t re-enabling properly but didn’t realise this was the cause of the failure shut down! Maybe you can submit a pull request with that fix? Or are there other things in that branch that we should avoid bringing over?

Phoenix also wants us to switch from using AddSimpleTool() to AddTool() but that switch isn’t trivial keeping support for both at once (the whole signature has changed :frowning: )

I created a new branch because I was afraid that fix may be incompatible with wx3.0.2; however, I found no compatibility issue at present. I’ll submit a pull request.

I guess that switching from AddSimpleTool() to AddTool() would not be urgent issue. I’ll try it after other issues are solved :slightly_smiling_face:.

Creating a branch was the right thing to do :slight_smile:

In wx4.0 Conditions dialog is really wide :smiley:. The third positional parameter, gap, is necessary for wx.FlexGridSizer() to specify rows and columns in wx4.0. I’ve fixed this problem.

Now I’m annoyed about a warning dialog in Coder. When a file opened in Coder is modified outside of PsychoPy, Coder show a warning dialog. When this dialog is activated by clicking file tab in Coder window, the dialog is shown twice. This happens both in Python 2 and 3 with wx4.0.

I found that psychopy.app.coder.CoderFrame.pageChanged() shows the warning dialog, and pageChanged() is called twice at that time. pageChanged() checks modified time of the file to decide to show the dialog, but modified time doesn’t seem to updated properly at the first call. At present I have no smart idea to fix this issue :disappointed_relieved:.

Doesn’t fix the pageChanged() issue, and I’m sure we’ll find more issues but, on the plus side the test suite does now pass all its tests, so at least we don’t have any seg faults now! :slight_smile:

Ouch, I cannot open Components’ Properties Dialog and Loop Properties Dialog after pulled the latest main branch today! I think self.Show() in Line 840 of psychopy/app/builder/dialogs/__init__.py should be self.ShowModal(). In addition, DlgLoopProperties class needs timeout.

I pushed this fix to my main branch. Does this fix have no negative effect on newly added timeout feature? If it is OK, I’ll send pull request.

Ah ok. Yes that would be the right fix and went damage anything else.
Actually once of the upshots of the timeout addition is that we’ll be able to add unit tests for dialog boxes. In the past we couldn’t do that because the program would wait for the dialog to disappear before continuing. Now we can open a dialog that will automatically close itself et can test much more of the app :slight_smile:

I’ve sent a pull request. Automation of testing process is cool :smile:.