Giter VIP home page Giter VIP logo

phoenix's Introduction

wxPython Project Phoenix

image

Introduction

Welcome to wxPython's Project Phoenix! Phoenix is the improved next-generation wxPython, "better, stronger, faster than he was before." This new implementation is focused on improving speed, maintainability and extensibility. Just like "Classic" wxPython, Phoenix wraps the wxWidgets C++ toolkit and provides access to the user interface portions of the wxWidgets API, enabling Python applications to have a native GUI on Windows, Macs or Unix systems, with a native look and feel and requiring very little (if any) platform specific code.

Note

This document is primarily intended for those who will be working on wxPython, or at least building with the source code fetched directly from GitHub. If that's not you then please refer to the instructions at the wxPython website about how to get the current release of wxPython for your platform and chosen Python environment.

Contents

How to build wxPython Phoenix

First of all, this README is intended primarily for those who want to build wxPython from a workspace checked out from the wxPython Phoenix repository. If you are not making changes to wxPython, or needing to build it for some unsupported compiler or some other hardware architecture, then you probably do not need to put yourself through the pain for building in this way. It's a complicated build, and can sometimes be confusing even for the experts. Instead, if the binaries available at PyPI are not what you need then you can use pip to build from the released source archives, or from the source archives created in the pre-release snapshot builds. See the notes about it at:

Next, review the section below about prerequisites.

All aspects of the wxPython Phoenix build are managed through a series of commands provided by the build.py script. There is also a setup.py script available for those who are used to the standard distutils or setuptools types of builds. The setup.py script assumes that all of the code generation steps have already been performed, and so it is suitable for use when building from a source snapshot tarball or when using easy_install or pip. The setup.py script will delegate to build.py for the actual build, and build.py will delegate to setup.py when doing setuptoolsy things like performing an install or building a wheel.

Using the build.py script allows for greater control over the build process than setup.py does, including commands for performing the various code-generation steps. So developers working on Phoenix itself or building from a Git checkout, instead of a source snapshot tarball, should be using the build.py script. The build.py script provides a fairly simple command-line interface consisting of commands and options. To see the full list run python build.py --help. The most important commands are listed below.

Windows Users NOTE: If you are building Phoenix on Windows and have a non-English language installation of Microsoft Visual Studio then you may need to set the code page in your console window in order to avoid Unicode decoding errors. For example:

chcp 1252
python build.py <build commands>...

In addition, some tasks within the build currently expect to be able to use Cygwin on Windows (https://www.cygwin.com/) to do its work. If you have Cygwin installed in one of the default locations (c:\cygwin or c:\cygwin64) then all is well. If you have it installed somewhere else then you can set CYGWIN_BASE in the environment and the build tool will use that for the base dir.

On the other hand, if you just want to do a standard setuptools-style build using setup.py and are using a full source tarball, then you can stop reading at this point. If you want to build from a source repository checkout, or need to make changes and/or to regenerate some of the generated source files, then please continue reading.

Building wxWidgets

Since build.py will, by default, build both wxWidgets and Phoenix you will need the wxWidgets code as well. The source tarballs already include both wxWidgets and the Phoenix source code, so if you are getting your copy of the source code that way then you are all set. If you are fetching it from GitHub you will need to do an additional step. The git repository is set up to bring in the wxWidgets code as a git "submodule" so after cloning the Phoenix repository, you can get the wxWidgets source with these commands:

$ git submodule update --init --recursive

This will clone the wxWidgets repo into: Phoenix/ext/wxWidgets. Once the submodule is updated, the build script should be able to build wxWidgets.

If you would rather use an already built and installed wxWidgets then that is possible as well by changing some options, see python build.py --help for details. However be aware that doing so will require a wxWidgets that is very close to the same age as the Phoenix code, at least for the unreleased preview snapshots. In other words, the wxWidgets build should use code from the wxWidgets source repository within a few days of when the Phoenix code was checked out. Currently the master branch of Phoenix is tracking the master branch of wxWidgets.

On the other hand, it is probably best to just let wxPython build and bundle wxWidgets. The build tools will by default build wxWidgets in a way that allows it to be bundled with the wxPython extension modules as part of the wxPython package, meaning it can peacefully coexist with any wxWidgets libraries you may already have installed. This bundling of the wx shared libraries works on Windows, OSX and Linux, and probably any other unix-like system using shared libraries based on the ELF standard. The libraries are built in such a way that they are relocatable, meaning that they do not have to be in a fixed location on the filesystem in order to be found by the wxPython extension modules. This also means that you can do things like use pip to install a wxPython wheel in one or more virtual environments, move the wx package to a versioned folder, or even move it into your own project if desired, all without needing to rebuild the binaries. (Assuming that compatible Pythons are being used in all cases of course.)

The build phase of the build.py script will copy the results of the wxWidgets and Phoenix builds into the wx folder in the Phoenix source tree. This will allow you to run and test Phoenix directly from the source tree without installing it, if desired. You just need to set PYTHONPATH appropriately, or you can use python setup.py develop or pip install -e . to install an .egg-link file in your current Python site-packages folder that will point to the folder where you built wxPython Phoenix. When you are finished testing you can then use the install or one of the bdist commands like you normally would for other Python packages.

Important build.py commands

The following build.py commands are required to be able to build Phoenix from scratch. In other words, from a pristine source tree with none of the generated code present yet. They can be run individually or you can specify all of them on a single command line, in the order given. Once a command has succeeded in one run of build.py there is no need to run that command again in a later run, unless you've changed something which that command has the responsibility to process. Many of the commands require the results of the earlier commands, so at least the first time you run the build you will need to use all 4 of the commands (or their equivalents for composite commands) in the given order.

  • dox: Builds the XML files from the wxWidgets documentation source, which will be used as input for the etg command.
  • etg: Extracts information from the dox XML files, runs hand-written tweaker code on the extracted data structures, and runs various generators on the result to produce code for the next steps. The code being run for each item in this step is located in the etg folder in the Phoenix source tree.
  • sip: This command processes the files generated in the etg command and produces the C++ code that will become the Python extension modules for wxPython Phoenix.
  • build: Build both wxWidgets and wxPython. There are additional commands if you want to build just one or the other. The results will be put in the Phoenix/wx folder, and can be used from there without installation if desired, by setting PYTHONPATH so the Phoenix/wx package dir is found by Python.

Some other useful commands and options are:

  • clean: Clean up the build products produced by prior runs of build.py. There are additional clean commands that will let you clean up just portions of the build if needed.
  • touch: Updates the timestamp on all of the etg scripts, so they will be forced to be run in the next build. This is useful when a change has been made to the wxWidgets documentation that needs to be propagated through the build since the etg command doesn't yet do full dependency checking of the input.
  • M.N: This is the Major.Minor version number of the Python that the extension modules will be built for, such as "3.3". This allows you to run build.py with a different Python than what you are building for, which is handy for things like buildbots running in a virtualenv for one Python that need to be able to run builds for other versions too.

    If build.py is not able to find the correct Python given the M.N on the command line then you can specify the full path to the python executable you want to use with the --python option.

  • test: Runs all of Phoenix's unittests.
  • --nodoc: This option turns off the sphinx generator when running the etg scripts. If you don't plan on generating the documentation then this will speed up the processing of the etg command.

Please see the output of python build.py --help for information about commands and options not mentioned here. And, as always, if there is any discrepancy between this document and the source code in the build.py script, then the source code is correct. ;-)

The build.py script will download doxygen, sip and waf for your platform as needed if they are not already in your Phoenix/bin folder. If prebuilt versions of these tools are not available for your platform then build.py will bail out with an error message. To continue with the build you will need to acquire copies of the tool that will work on your platform and can then tell build.py where to find it using an environment variable, as described in the error message.

Example build command-lines

To do a complete build from a totally clean git workspace, you will need to use several of the commands listed above. For example:

python build.py dox etg --nodoc sip build

Subsequent builds can leave out some of the commands if there were no changes which would require those commands to be run again. For example, if you wanted to just rebuild the Phoenix extension modules you could do this:

python build.py build_py

If you've changed one of the etg files and need to regenerate and rebuild the source affected by that change, then you can use a command like this:

python build.py etg --nodoc sip build build_py

Project directory structure

There are a lot of subfolders in this directory, here is a brief explanation to help a newbie find their way around.

  • build: Intermediate files produced by the build process are stored here. This folder should not be committed to a source repository.
  • buildtools: This is a Python package containing modules that are used from build.py and setup.py and which assist with configuring and running the build.
  • etg: This is where the "Extractor-Tweaker-Generator" scripts are stored. These scripts are invoked by the build and they will read the XML files produced by Doxygen and will produce interface definition files for SIP.
  • etgtools: This Python package contains modules which assist with the parsing of the XML files, tweaking the collection of objects produced by the parser, and also the backend generation of code or documentation.
  • ext: This folder holds the source for external projects used by Phoenix, (currently just wxWidgets) as git submodules. This allows Phoenix to use a specific revision of the code in the other projects and not depend on the developer fetching the correct version of the code on their own.

    When you first checkout the Phoenix source using git you will need to tell git to also fetch the submodules, like this:

    cd Phoenix
    git submodule init
    git submodule update --recursive
  • sip/gen: The code (.sip files) produced by the ETG scripts is placed in this folder.
  • sip/cpp: The code produced when running SIP is put in this folder. It will be C++ source and header files, and also some extra files with information about the source files produced, so the build knows what files to compile.
  • sip/siplib: This is a copy of the SIP runtime library. We have our own copy so it can be included with the wxPython build as an extension module with a unique name (wx.siplib) and to not require a runtime dependency on SIP being installed on the target system. 3rd party extensions that want to integrate with wxPython should ensure that the sip.h they #include is the one in this folder.
  • src: This folder is for any other source code (SIP, C++, Python, or anything else) that is edited by hand instead of being generated by some tool.
  • wx: This is the top of the wxPython package. For an in-place build the extension modules and any associated files will be put into this folder. Subfolders contain pure-python subpackages of the wx package, such as wx.lib, etc.

Naming of files

To help keep things a little easier when looking for things that need to be worked on, the file names in the Phoenix project will mirror the names of the files in the wxWidgets interface headers folder. For example, if there is a interface/wx/FOO.h and we are processing the XML produced for that file then the ETG script for the classes and other items will be named etg/FOO.py and it will produce sip/gen/FOO.sip, unit tests will be in unittests/test_FOO.py, and so on.

In most cases more than one ETG/SIP file will be used to create a single Python extension module. In those cases there will be one ETG script used to bring all the others together into the single extension module (by using the back-end generator's include feature for example.) The names of those scripts will have a leading underscore, such as etg/_core.py, and all the scripts that are intended to be included in that extension module should specify that name in their MODULE variable.

Prerequisites

The following are some tips about what is required to build Phoenix for yourself. There are likely some other things that may not have been mentioned here, if you find something else that should be mentioned then please submit a PR for updating this document.

Windows

All the source code needed for wxWidgets and wxPython Phoenix are included in the wxWidgets and Phoenix source trees. In addition to a stock Python installation you will also need a copy of Visual Studio 2008 (for Python2.7 compatibility) or Visual Studio 2015 (for Python 3.x support). It should also be possible to build using Mingw32, but there will need to be some changes made to the build scripts to support that.

You may also want to get a copy of the MS SDK in order to have newer definitions of the Windows API. I typically use 7.0 or 7.1 with Visual Studio 2008.

Unfortunately Microsoft no longer distributes Visual Studio 2008. But don't panic! They have recently made available a "Microsoft Visual C++ Compiler for Python 2.7" package, which can also be used for building Phoenix for Python 2.7. Plus it's free! You can get it at: http://www.microsoft.com/en-us/download/details.aspx?id=44266

If you want to build Phoenix with debug info then you will need to first build a debug version of Python, and then use that Python (python_d.exe) to build Phoenix.

Linux

On Ubuntu the following development packages and their dependencies should be installed in order to build Phoenix. Other debian-like distros will probably also have these or similarly named packages available, or newer versions of Ubuntu might have evolved somewhat and require changes from this list. Extrapolate other package names accordingly for other linux distributions or other unixes.

  • dpkg-dev
  • build-essential
  • python3-dev
  • freeglut3-dev
  • libgl1-mesa-dev
  • libglu1-mesa-dev
  • libgstreamer-plugins-base1.0-dev
  • libgtk-3-dev
  • libjpeg-dev
  • libnotify-dev
  • libpng-dev
  • libsdl2-dev
  • libsm-dev
  • libtiff-dev
  • libwebkit2gtk-4.0-dev
  • libxtst-dev

If you are building for GTK2 then you'll also need these packages and their dependencies:

  • libgtk2.0-dev
  • libwebkitgtk-dev

If You use a custom built python in a non standard location, You need to compile python with the --enable-shared option.

Mac OSX

Like the Windows platform all the source and libs you need for building Phoenix on OSX are included in the wxWidgets and Phoenix source trees, or by default on the system. In addition you will need to get the Xcode compiler and SDKs, if you don't already have it, from https://developer.apple.com/ (free registration required). You should also install the command line tools for your version of Xcode and OSX. This can usually be done from within Xcode or via a separate installer package.

Also like on Windows, using the same or similar compiler that was used to build Python usually helps things to work better and have a better chance for success. For example, the stock Python 2.7 will try to use "gcc-4.2" when building extensions, but newer versions of Xcode may not have that command available. I am currently using Xcode 7.1.1.

If all else fails it is not too hard to build Python yourself using whatever Xcode you have installed, and then use that Python when building Phoenix.

Help and Helping

Most discussions about Phoenix happen on the wxPython-dev google group (a.k.a. the wxPython-dev mail list.) If you have questions or would like to get involved please subscribe to the group at https://groups.google.com/forum/#!forum/wxpython-dev and join in.

Latest Snapshot Builds

You can find snapshots of the latest wxPython Phoenix build files, including source snapshots, wheels files for Windows and Mac, and etc. at: https://wxpython.org/Phoenix/snapshot-builds/. These files are built at most once per day, on any day that has had a commit to the master branch.

image

phoenix's People

Contributors

acollange avatar arjones6 avatar cbeytas avatar david-hughes avatar dietmarschwertberger avatar dougthor42 avatar driscollis avatar eagerm avatar gadgetsteve avatar infinity77 avatar jensgoe avatar jeremyd2019 avatar jmoraleda avatar kdschlosser avatar kollivier avatar komoto48g avatar mesalu avatar metallicow avatar pauldmccarthy avatar pbrod avatar pchemguy avatar pieleric avatar ricpol avatar robind42 avatar stefanbruens avatar swt2c avatar thomasp0815 avatar topic2k avatar wernerfb avatar wettenhj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phoenix's Issues

Not able to use VLC python binding to play a video

I am on Mac OSX 10.11.1, python 2.7.11, installed wxpython via homebrew and the version is 3.0.2. I am trying to play a video through VLC python binding. I need to set a window handle to the vlc player for the video to be drawn on.

I tried the following:

self._vlc_player.set_nsobject(self._video_content_panel.GetHandle())

but there's no video. After reading this stackoverflow post (http://stackoverflow.com/questions/31014804/nsview-from-wxpython), I realized that this may be an issue with how wxpython is done. Is there an easy way to get the NSView wrapped in the ControlRef? What would you suggest me do there?

Thanks!

Phoenix demo - not able to start

I have tried to run the Phoenix demo, both with Phoenix compiled by me from source and also with the pre-compiled snapshot build named "wxPython_Phoenix-3.0.3.dev1964+f780b21"

I get this, no matter what I do:

D:\MyProjects\Phoenix\demo>python Main.py
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\wx\core.py", line 1955, in Notify
self.notify()
File "C:\Python27\lib\site-packages\wx\core.py", line 3034, in Notify
self.result = self.callable(_self.args, *_self.kwargs)
File "Main.py", line 2601, in ShowMain
frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
File "Main.py", line 1531, in init
self.SetOverview(self.overviewText, mainOverview)
File "Main.py", line 2130, in SetOverview
self.nb.SetPageText(0, os.path.split(name)[1])
SystemError: ..\Objects\longobject.c:998: bad argument to internal function

I have checked that the arguments of SetPageText make sense (int and str). I am unclear what the message exactly means...

This is on Windows 10 64 bit, Python 27 64 bit.

Andrea.

python interpreter crashing instead of getting PyNoAppError

Phoenix is crashing the interpreter, and when I boiled my code down to the bare minimum I discovered it was an issue where I was catching an exception and then trying to display it in a MessageDialog before I had created the wx.App object.

Attached is the result of the code simplification.

Here's is the program's output from wxPython-classic:

3.0.2.0 msw (classic)
Traceback (most recent call last):
File "crash_phoenix.py", line 6, in
dlg = wx.MessageDialog ( parent=None, message='boom', caption='Crash', style=wx.OK|wx.ICON_ERROR )
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx_windows.py", line 3631, in init
windows.MessageDialog_swiginit(self,windows.new_MessageDialog(_args, *_kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!

However, when run from phoenix, it crashes the python interpreter

3.0.3.dev2648+23be602 msw (phoenix)
(crash)

crash_phoenix.zip

wx.dataview.TreeListCtrl incompatible with VirtualTree mixin

It's unclear to me whether wx.dataview.TreeListCtrl is supposed to be working with wx.lib.mixins.treemixin.VirtualTree. TreeListCtrl was taken out of the TreeMixin demo, so I tried to put it back, but I get:

Traceback (most recent call last):
  File "/home/anna/dev/Phoenix/demo/TreeMixin.py", line 232, in OnPageChanged
    newTree.RefreshItems()
  File "/home/anna/dev/Phoenix/wx/lib/mixins/treemixin.py", line 371, in RefreshItems
    self.RefreshChildrenRecursively(rootItem)
  File "/home/anna/dev/Phoenix/wx/lib/mixins/treemixin.py", line 389, in RefreshChildrenRecursively
    reusableChildren = self.GetItemChildren(item)
  File "/home/anna/dev/Phoenix/wx/lib/mixins/treemixin.py", line 240, in GetItemChildren
    child, cookie = self.GetFirstChild(item)
TypeError: 'TreeListItem' object is not iterable

Is this something to be fixed for the release? Or VirtualTree can't be used with TreeListCtrl anymore? What's the alternative?

UltimateListCtrl broken(?) on Python 3

I'm on OS/X using Python 3 and the latest release, and the code appears identical to what's currently in trunk. I'm trying to display a very simple ULC_VIRTUAL list with one string column.

I'm getting an error on line (seriously?) 8059 of ultimatelistctrl.py: "AttributeError: 'KeyEvent' object has no attribute 'm_keyCode'" Which seems entirely likely given that the code indicates support for >= or < v2.9. :)

Apparently ULC directly accesses the raw members of KeyEvent, and... maybe these are different in the v3 port? No idea.

Normally I'd submit a patch but I don't have a wxPython build environment at the moment.

Installed from pip missing hyperlinks modules

Hello. I tried to use Phoenix with Mullvad Linux application. Installed Phoenix from pip (pip install wx).

First of all, pip installation doesn't check, if webkitgtk installed. Phoenix doesn't compile without webkitgtk.

And second, when Phoenix is installed, I can't launch Mullvad Linux application with it. It says, that hyperlinks module is missing. I installed all modules from requirements file before installing Phoenix.

import wx.lib.hyperlink
ImportError: No module named hyperlink

failed GTK_IS_CELL_EDITABLE assertion in CustomRenderer.py

The CustomRenderer.py sampe provided in samples/dataview prints the following messages to console :

(CustomRenderer.py:14794): Gtk-CRITICAL **: IA__gtk_cell_editable_editing_done: assertion 'GTK_IS_CELL_EDITABLE (cell_editable)' failed

(CustomRenderer.py:14794): Gtk-CRITICAL **: IA__gtk_cell_editable_remove_widget: assertion 'GTK_IS_CELL_EDITABLE (cell_editable)' failed

This happens if I enter editing the 'Genre' field, then leave it and navigate to another record, and it keeps happening on each move. This happens on a freshly built Phoenix and wxWidgets from git, and I have gtk2 2.24.30-2 and gtk3 3.20.6-1 installed under Arch linux (not sure which one is used). Note that classic wxPython doesn't seem to have this issue.

PropertyGrid issues

Any use of PropertyGridManager crashes Python (3.5 with one of the recent snapshots)

The demo does not start. I've attached a version which at least starts, but then crashes...
I had to deactivate the event stuff in TestPanel.init
PropertyGrid.zip

Missing from the implementation:

  • EVENTS
  • LABEL_AS_NAME is missing. Not sure whether this is required; it was defined as LABEL_AS_NAME = "@!"

Regards,

Dietmar

PropertyGrid crash

I've been unable to get a PropertyGrid to work successfully. It crashes every time. It appears to be inside a paint method, possibly some refcount problem? We weren't able to dig too deeply into it.

Attached is an example script illustrating the crash.

Oddly enough, if I use Wing IDE to set a breakpoint in the init method, then step through to MainLoop() line-by-line, the frame and propgrid show up fine, no crash.

This is on Windows 8.1 Professional 64-bit, running wxPython Phoenix snapshot 3.0.3.dev2733, built locally for Python 3.5.2 64-bit.

interpreter crash with ribbonbar_demo

the ribbonbar_demo.py in the samples directory crashes the interpreter clicking on the appearance tab (no problem with the agw version of ribbon demo). With py3.4 64bit on win7

Upload to pypi?

Are there any plans to upload releases considered stable (or "mostly" stable) to pypi? I assume that's an obvious question, but:

  • It's the defacto standard for python packages.
  • It would make it very easy for projects to require phoenix as a dependency in setup.py (which is why I'm creating this issue).
  • It would expose phoenix to a broader community and the fact that wxpython can actually be run under python 3 rather successfully.
  • It would prevent any downtime of the wxpython.org website affecting availability of obtaining wxpython, reading the documentation, or deterring users for other embarrassing reasons such as this:

image

In the event that automatic installation fails via pip because of external dependencies needed, such as a missing compiler, etc., further instructions could be given to the user to read the README.rst or the like.

Appreciate the consideration and all of the work in this project!

FloatSpin not handling spin event correctly when near initial value

import wx
import wx.lib.agw.floatspin as FS

class MainApp(wx.App):
    def OnInit(self):
        frame = Main(None, -1, 'floatspin test')
        frame.Show()
        return True

class Main(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)

        spn = FS.FloatSpin(self, -1, increment=0.1, value=4.0)

        vb = wx.BoxSizer(wx.VERTICAL)
        vb.Add(spn)
        self.SetSizer(vb)

if __name__ == "__main__":
    app = MainApp(0)
    app.MainLoop()

Clicking up button to 4.2 and then down button to 3.9 gives the following: 4.0, 4.1, 4.2, 4.1, 4.0, 4.1, 4.0, 3.9
Clicking up button from 3.9 gives: 3.9, 4.0, 4.1, 4.0, 4.1, 4.2

This only occurs at the initial value. If you set an initial value of 5.0 then the same behaviour occurs around there. Also, you can see the button animation is correct when clicking.

Python version: 3.5.1
wx.version() gives 3.03.dev1964+f780b21

Printing or escaping "&" not working in wx.RadioBox but OK in wx.RadioButton

I was not able to test with C++ but with all versions of wxPython it is not possible to escape the "&" by using the "&&" in radio items labels when in a wx.RadioBox. If the radio items are built with wx.RadioButton the "&" are processed as special function, or printed by using "&&".
Below are screenshots for the different wxPython versions I tested. (I really need to print values like &{dictionary}).
radio_box_no_double_ampersand_281201
radio_box_no_double_ampersand_295
radio_box_no_double_ampersand_302
radio_box_no_double_ampersand_303

Users without 'see internal items' permission gets 404 for existing (closed) items

It seems that #2026 has introduce a new bug:

  • Start with new DB.
  • Deactivate the 'see internal items' permission for guests.
  • Activate guests.
  • Create new agenda item. -> Guest can see this item in /rest/agenda/item but not in /rest/agenda/item/1 (404).
  • Set item to closed. -> Guest can not access to /rest/agenda/item/1/ -> gets a 404

Sometimes a reload helps to see the closed item in agenda list view. Here is something broken... Important for next beta release.

exception with wx.lib.agw.aui.AuiNotebook

from the demo, dragging a tab and dropping it in another position raises this (win7, phoenix 64bit-py3.4):

Traceback (most recent call last):
File "c:\python34\lib\site-packages\wx\lib\agw\aui\auibook.py", line 2023, in
OnLeftUp
self.ReleaseMouse()
wx._core.wxAssertionError: C++ assertion "!wxMouseCapture::stack.empty()" failed
at ....\src\common\wincmn.cpp(3319) in wxWindowBase::ReleaseMouse(): Releasing
mouse capture but capture stack empty?

Inconsistent deprecated method warnings

The wx.Window methods GetSizeTuple() and GetPositionTuple() are now deprecated in favour of the methods GetSize() and GetPosition() respectively. However use of the deprecated methods raises different responses:

wxPyDeprecationWarning: Call to deprecated item. Use GetPosition instead
usr.nutrselectpos = self.GetPositionTuple()

Traceback (most recent call last):
File "e:\PyDevSrc7\Dp710\allsource\dialogs\nutrselect.py", line 185, in OnOk
usr.nutrselectsize = self.GetSizeTuple()
AttributeError: 'dpNutrSelect' object has no attribute 'GetSizeTuple'

AuiManager fails in ubuntu 16.04/py35

Hi, I have troubles with Aui docks under python 3.5 which I build from Phoenix sources under Ubuntu 16.04. The following minimal script fails when trying to resize the docked panel.

import wx
import wx.lib.agw.aui as aui

class Window(wx.Frame):

    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)

        manager = self.manager = aui.AuiManager(self)

        panel1 = wx.Panel(self, -1, size=wx.Size(-1, -1))
        panel2 = wx.Panel(self, -1, size=wx.Size(-1, -1))

        info1 = aui.AuiPaneInfo().Center()
        info2 = aui.AuiPaneInfo().Left()

        manager.AddPane(panel1, info1)
        manager.AddPane(panel2, info2)
        manager.Update()

app = wx.App()
win = Window(None)
win.Show(True)
app.MainLoop()

No error message is thrown. Under python 2.7, no problems.
Thanks, jus

pip install from git / compiling fails under Windows

Windows 7 x64
Python 3.5 x64
MSVC 2015 Update 1 (14.0)

(I am not that familiar with the internals of wxpython.)
I tried requiring wxpython in setup.py and building from the git source (not using wheels from http://wxpython.org/Phoenix/snapshot-builds/) using the recommended compiler for python 3.5. Several things do compile correctly, but then it:

  • Prints a "warning": WARNING: msgfmt command not found, message catalogs not rebulit. Please installgettextand associated tools. then continues on its merry way. (Does this warning matter? Where would I find gettext?)
  • Stops at: FileNotFoundError: [Errno 2] No such file or directory: 'sip\\cpp\\_core.sbf' (why is this missing?)

Log:

<snip>
    glcmn.cpp
        cl /c /nologo /TP /Fovc140_mswudll_x64\gldll_glcanvas.obj /MD /DWIN32  /Zi  /Fd..\..\lib\vc140_x64_dll\wxmsw30u_gl_vc140_x64.pdb   /O2 /D_CRT_SECURE_NO_DEPRECATE=1
 /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1  /D__NO_VC_CRTDBG__ /D__WXMSW__    /DNDEBUG     /D_UNICODE   /I..\..\lib\vc140_x64_dll\mswu /I..\..\include
/W4  /DWXBUILDING /I..\..\src\tiff\libtiff /I..\..\src\jpeg /I..\..\src\png  /I..\..\src\zlib /I..\..\src\regex /I..\..\src\expat\lib /DWXUSINGDLL  /DWXMAKINGDLL_GL /GR /EHsc /Yu"wx/wxprec.h"  /Fp"vc140_mswudll_x64\wxprec_gldll.pch"   ..\..\src\msw\glcanvas.cpp
    glcanvas.cpp
        rc /fovc140_mswudll_x64\gldll_version.res  /d WIN32  /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 /d __NO_VC_CRTDBG__  /d __WXMSW__   /d NDEBUG    /d _UNICODE  /i ..\..\lib\vc140_x64_dll\mswu /i ..\..\include  /d WXBUILDING /d WXDLLNAME=wxmsw30u_gl_vc140_x64  /i ..\..\src\tiff\libtiff /i ..\..\src\jpeg /i ..\..\src\png /i ..\..\src\zlib /i ..\..\src\regex /i ..\..\src\expat\lib /d WXUSINGDLL /d WXMAKINGDLL_GL ..\..\src\msw\version.rc
    Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
    Copyright (C) Microsoft Corporation.  All rights reserved.

        link /DLL /NOLOGO /OUT:..\..\lib\vc140_x64_dll\wxmsw30u_gl_vc140_x64.dll  /DEBUG /pdb:"..\..\lib\vc140_x64_dll\wxmsw30u_gl_vc140_x64.pdb" /opt:ref /opt:icf  /MACHINE:X64 /LIBPATH:..\..\lib\vc140_x64_dll   @F:\temp\nmFED1.tmp
       Creating library ..\..\lib\vc140_x64_dll\wxmsw30u_gl.lib and object ..\..\lib\vc140_x64_dll\wxmsw30u_gl.exp
    WARNING: msgfmt command not found, message catalogs not rebulit.
             Please install gettext and associated tools.
    Finished command: build_wx (7m11.263s)
    Running command: build_py
    Checking for F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf-1.7.15-p1...
    Not found.  Attempting to download...
    Connection successful...
    Data downloaded...
    Checking for F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf-1.7.15-p1...
    MSVC: E:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe
    "h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe" F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf-1.7.15-p1 --msvc_arch=x64 --python="h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe" --out=build/waf/3.5/x64/release configure build
    Setting top to                           : F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964
    Setting out to                           : F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\build\waf\3.5\x64\release
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\x86_ARM\CL.exe
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\amd64\CL.exe
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\x86_amd64\CL.exe
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\amd64\CL.exe
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\CL.exe
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\amd64\CL.exe
    Checking for program CL                  : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\amd64\CL.exe
    Checking for program LINK                : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\amd64\LINK.exe
    Checking for program LIB                 : E:\Program Files (x86)\Microsoft Visual
 Studio 14.0\VC\BIN\amd64\LIB.exe
    Checking for program MT                  : C:\Program Files (x86)\Windows Kits\10\bin\x64\MT.exe
    Checking for program RC                  : C:\Program Files (x86)\Windows Kits\10\bin\x64\RC.exe
    Checking for program python              : h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe
    Checking for python version              : (3, 5, 1, 'final', 0)
    'configure' finished successfully (34.820s)
    Waf: Entering directory `F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\build\waf\3.5\x64\release'
    Traceback (most recent call last):
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Scripting.py", line 97, in waf_entry_point
        run_commands()
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Scripting.py", line 153, in run_commands
        ctx=run_command(cmd_name)
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Scripting.py", line 146, in run_command
        ctx.execute()
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Scripting.py", line 353, in execute
        return execute_method(self)
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Build.py", line 106, in execute
        self.execute_build()
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Build.py", line 109, in execute_build
        self.recurse([self.run_dir])
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf3-1.7.15-9c6c439a6416a92b3e844736c4ef3c7b\waflib\Context.py", line 125, in recurse
        user_function(self)
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\wscript", line 466, in build
        source   = getEtgSipCppFiles(etg) + rc,
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\buildtools\config.py", line 634, in getEtgSipCppFiles
        return _getSbfValue(etg, 'sources')
      File "F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\buildtools\config.py", line 627, in _getSbfValue
        for line in open(sbf):
    FileNotFoundError: [Errno 2] No such file or directory: 'sip\\cpp\\_core.sbf'
    Command '"h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe" F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\bin\waf-1.7.15-p1 --msvc_arch=x64 --python="h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe" --out=build/waf/3.5/x64/release configure build ' failed with exit code 2.
    Finished command: build_py (0m49.505s)
    Finished command: build (8m0.768s)
    Command 'h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe -u
 build.py build' failed with exit code 2.

    ----------------------------------------
Command "h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='F:\\temp\\pip-build-zda2eowp\\wxPython-Phoenix-3.0.3.dev1964\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record F:\temp\pip-8zmht2kw-record\install-record.txt --single-version-externally-managed --compile --install-headers h:\mydocu~1\progra~1\worksp~1\photos~2\symbio~2\env\include\site\python3.5\wxpython-phoenix" failed with error code 2 in F:\temp\pip-build-zda2eowp\wxPython-Phoenix-3.0.3.dev1964\

AttributeError: 'module' object has no attribute 'ListViewComboPopup'

Hi,

I'm trying to use a ComboCtrl in my application. From the docs:

http://wxpython.org/Phoenix/docs/html/ComboCtrl.html

I tried their example:

comboCtrl = wx.ComboCtrl(self, wx.ID_ANY, "")

popupCtrl = wx.ListViewComboPopup()

# It is important to call SetPopupControl() as soon as possible
comboCtrl.SetPopupControl(popupCtrl)

# Populate using wx.ListView methods
popupCtrl.InsertItem(popupCtrl.GetItemCount(), "First Item")
popupCtrl.InsertItem(popupCtrl.GetItemCount(), "Second Item")
popupCtrl.InsertItem(popupCtrl.GetItemCount(), "Third Item")

Which raises an attribute error:

AttributeError: 'module' object has no attribute 'ListViewComboPopup'

In the docs example, an instance of wx.ComboPopup named "ListCtrlComboPopup" is created.

Am I correct in saying, this should be passed to comboCtrl.SetPopupControl? And not wx.ListViewComboPopup(), which does not actually exist?

wx.DIALOG_EX_CONTEXTHELP

I've been trying to create a help button for my application, but I wasn't able to implement the help button without removing the minimize and maximize button. Is this something that just can't happen with wx?

Roadmap

I'm happy see the project is moving along at a fast pace currently.

May you provide us with a rough estimate on when a "stable" version of wxPython Phoenix will be released? Is there a status page we can follow? Do you plan to support wxWidgets 3.1 in the first official Phoenix release, or upgrade afterwards?

There's quite a few different places where you can find information on the project and its status and they seem to be out of sync, so a quick update on the front page of the wxPython website on current status, plans, and where to find information would be great!

Regression: FloatCanvas.FCObjects.Group does not create a bounding box before trying to add objects

7100d73 added a regression to the Group(DrawObject) class wherein a bounding box is not created before attempting to add objects.

Traceback (most recent call last):
  File "wm_app.py", line 165, in <module>
    main()
  File "wm_app.py", line 160, in main
    plot_die_centers=True,
  File "wm_app.py", line 119, in __init__
    plot_die_centers=self.plot_die_centers,
  File "C:\gitlab\dthor\wafer_map\wafer_map\wm_frame.py", line 103, in __init__
    self._init_ui()
  File "C:\gitlab\dthor\wafer_map\wafer_map\wm_frame.py", line 139, in _init_ui
    plot_die_centers=self.plot_die_centers,
  File "C:\gitlab\dthor\wafer_map\wafer_map\wm_core.py", line 137, in __init__
    self._init_ui()
  File "C:\gitlab\dthor\wafer_map\wafer_map\wm_core.py", line 163, in _init_ui
    self.draw_wafer_objects()
  File "C:\gitlab\dthor\wafer_map\wafer_map\wm_core.py", line 298, in draw_wafer_objects
    self.wafer_info.flat_excl)
  File "C:\gitlab\dthor\wafer_map\wafer_map\wm_core.py", line 622, in draw_wafer_outline
    excl_group = FloatCanvas.Group([excl_arc, excl_notch])
  File "C:\WinPython34_x64\python-3.4.3.amd64\lib\site-packages\wx\lib\floatcanvas\FCObjects.py", line 2728, in __init__

    self.AddObject(obj)
  File "C:\WinPython34_x64\python-3.4.3.amd64\lib\site-packages\wx\lib\floatcanvas\FCObjects.py", line 2756, in AddObject
    self.BoundingBox.Merge(obj.BoundingBox)
AttributeError: 'Group' object has no attribute 'BoundingBox'

Problem after opening an ActiveX window in wx.lib.activex

The changes submitted by Dietmar Schwertberger are now in the latest snapshot build but I am still having the same problem as when I added the changes by hand, namely getting a maximum recursion depth exceeded message.

In my case it is happening in a DoGetBestSize call in a flatnotebook that contains a labelnotebook with a page panel that contains the ActiveX window. Instead of the parent call progressively interrogating its children as the code is requesting it to do, the parent DoGetBestSize is called again - recursively.

I haven't been able to produce a small runnable sample yet but have just noted a similar error if the Widget Inspection Tool is used. It is OK before the Activex window is opened, but opening or refreshing WIT afterwards produces a similar maximum recursion depth exceeded in comparison error

linux x64 dev2054 --gtk3 python 3.5 builds fine but fails tests

Building with gtk2 does not have the unreferenced var. I googled around and found some fringe things near wxWidget space but was old and my system is XOrg, not Wayland I think, and thought mir was for that but frustrated I don't have enough experience to fix this myself. Thank you devs for your efforts. I wish I could contribute more than this.

I note there is a very similar issue https://github.com/wxWidgets/Phoenix/issues/86 but that was affected by _adv and this appears to be _core...

I built fresh wxWidgets 3.1.0 --with-gtk=3 from the March tar ball without issue and a git clone from a few minutes ago without issue; for perspective.

System:

Ubuntu Studio 16.04 x64
Linux 4.4.0-22-lowlatency #40-Ubuntu SMP PREEMPT Thu May 12 22:54:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Build line:

python3 build.py 3.5 dox etg --nodoc sip build --gtk3 --jobs=8

------------ BUILD FINISHED ------------
To use wxPython from the build folder (without installing):

  • Set your PYTHONPATH variable to /.../wxPython_Phoenix-3.0.3.dev2054+14a1ddd.
  • You may also need to set your (DY)LD_LIBRARY_PATH to /.../wxPython_Phoenix-3.0.3.dev2054+14a1ddd/build/wxbld/lib,
    or wherever the wxWidgets libs have been installed.

Finished command: build_py (6m18.824s)
Finished command: build (8m58.18s)
Done!

Running tests:

python3 build.py test

Build using: "/usr/bin/python3"
3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330]
Python's architecture is 64bit
cfg.VERSION: 3.0.3.dev2054+14a1ddd

Running command: test
"/usr/bin/python3" unittests/runtests.py
Traceback (most recent call last):
File "unittests/runtests.py", line 41, in
import wx
File "/.../wxPython_Phoenix-3.0.3.dev2054+14a1ddd/wx/init.py", line 17, in
from wx.core import *
File "/.../wxPython_Phoenix-3.0.3.dev2054+14a1ddd/wx/core.py", line 6, in
from ._core import *
ImportError: /.../wxPython_Phoenix-3.0.3.dev2054+14a1ddd/wx/libwx_gtk3u_core-3.0.so.0: undefined symbol: _Z24gdk_mir_display_get_typev
Command '"/usr/bin/python3" unittests/runtests.py ' failed with exit code 1.
Finished command: test (0.221s)
Done!

wx.ScrolledWindow AssertionError: DoShowScrollbars(): window must be created

In python 3.5 (OS: Ubuntu 16.04):

self.general_tab_scrolledwindow = wx.ScrolledWindow( self.settings_tabs, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL )
wx._core.wxAssertionError: C++ assertion "scrolled" failed at /tmp/pip-build-jo6wg6ff/wxPython-Phoenix/ext/wxWidgets/src/gtk/scrolwin.cpp(227) in DoShowScrollbars(): window must be created

Part of code (generated with wxFormBuilder):

wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Редактор настроек", pos = wx.DefaultPosition, size = wx.Size( 600,400 ), style = wx.DEFAULT_DIALOG_STYLE )

self.SetSizeHints( wx.Size( 600,400 ), wx.Size( -1,-1 ) )

sizer_settings_dialog = wx.BoxSizer( wx.VERTICAL )

self.settings_tabs = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.NB_TOP )
self.general_tab_scrolledwindow = wx.ScrolledWindow( self.settings_tabs, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL )

RuntimeError when opening/closing/opening WIT

Python: 2.7.9
wxPython: 3.0.3.dev2454+53f3c37 msw (phoenix)

Run the demo, open WIT (F6 or menu Help -> Open Widget Inspector) , close WIT and again open it via F6 or menu. Now i get a RuntimeError:

Traceback (most recent call last):
  File "D:\devel\wxPhoenix\demo\Main.py", line 2472, in OnOpenWidgetInspector
    InspectionTool().Show(wnd, True)
  File "C:\Python27sl\lib\site-packages\wx\lib\inspection.py", line 104, in Show
    app=self._app)
  File "C:\Python27sl\lib\site-packages\wx\lib\inspection.py", line 160, in __init__
    style=wx.NO_BORDER,
  File "C:\Python27sl\lib\site-packages\wx\py\crust.py", line 47, in __init__
    *args, **kwds)
  File "C:\Python27sl\lib\site-packages\wx\py\shell.py", line 342, in __init__
    self.execStartupScript(startupScript)
  File "C:\Python27sl\lib\site-packages\wx\py\shell.py", line 421, in execStartupScript
    self.push('')
  File "C:\Python27sl\lib\site-packages\wx\py\shell.py", line 972, in push
    self.more = self.interp.push(command)
  File "C:\Python27sl\lib\site-packages\wx\py\interpreter.py", line 82, in push
    command=command, more=more, source=source)
  File "C:\Python27sl\lib\site-packages\wx\py\dispatcher.py", line 147, in send
    response = _call(receiver, signal=signal, sender=sender, **kwds)
  File "C:\Python27sl\lib\site-packages\wx\py\dispatcher.py", line 176, in _call
    return receiver(**kwds)
  File "C:\Python27sl\lib\site-packages\wx\py\filling.py", line 69, in push
    self.display()
  File "C:\Python27sl\lib\site-packages\wx\py\filling.py", line 159, in display
    if self.IsExpanded(item):
RuntimeError: wrapped C/C++ object of type FillingTree has been deleted

There is no way to deselect rows in a grid

I used to use this grid.Deselect(row) so I could clear a single row selection. Now I don't see that there is a way to deselect a row. You can deselect a row by selecting a new row, but that's definitely not what I need to do. I need to select then deselect a row by clicking on the label of the same row, toggling the row selection. I read the documentation and looked at the examples, but there was no clear answer.

wx.BusyCursor contrext manager

The BusyCursor no longer seems to have a context manager. The following works as expected in clasic:
import time
import wx
app = wx.App()
wx.Frame(None).Show()
with wx.BusyCursor():
time.sleep(5)
app.MainLoop()

In Phoenix it raises "AttributeError: exit". Getting rid of the "with" block and using
wait = wx.BusyCursor() ... del wait
works as expected.

demo MediaCtrl can't run on Windows

wxPython/demo/MediaCtrl.py

the problem is that set the wrong backend.

     backend = ""
            if 'wxMSW' in wx.PlatformInfo:   
                # the default backend doesn't always send the EVT_MEDIA_LOADED
                # event which we depend upon, so use a different backend by
                # default for this demo.
                backend = wx.media.MEDIABACKEND_QUICKTIME

By the way, I have no idea about this setting quicktime backend on Windows.
A joke?

Cloned python object destroyed inside FindOrCloneDataType()

I'm trying to write my own cell editor for wx.grid, but getting segfaults. Here is a sample that reproduces the issue: https://gist.github.com/lvu/99411daf258cb067eece6b30f3bc5923.

I've included the trailing rows of valgrind python wxgrid.py in the gist, and the interesting ones are:

==31861== Invalid read of size 8
==31861==    at 0x134CBB8B: wxGridTypeRegistry::FindOrCloneDataType(wxString const&) (grid.cpp:9308)
...
==31861==  Address 0x14fdfcd0 is 0 bytes inside a block of size 128 free'd
==31861==    at 0x4C2C104: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31861==    by 0x13150854: sipwxGridCellEditor::~sipwxGridCellEditor() (sip_gridwxGridCellEditor.cpp:81)
==31861==    by 0x13152EB1: release_wxGridCellEditor (sip_gridwxGridCellEditor.cpp:1055)
==31861==    by 0x13152F2A: dealloc_wxGridCellEditor (sip_gridwxGridCellEditor.cpp:1067)
==31861==    by 0x1277D703: forgetObject (siplib.c:11399)
==31861==    by 0x1277CFC8: sipWrapper_dealloc (siplib.c:10962)
==31861==    by 0x4EF5CF8: ??? (in /usr/lib/libpython3.5m.so.1.0)
==31861==    by 0x1276C015: sip_api_parse_result_ex (siplib.c:2532)
==31861==    by 0x13120832: sipVH__grid_26(PyGILState_STATE, void (*)(_sipSimpleWrapper*, PyGILState_STATE), _sipSimpleWrapper*, _object*) (sip_gridcmodule.cpp:1100)
==31861==    by 0x131511D8: sipwxGridCellEditor::Clone() const (sip_gridwxGridCellEditor.cpp:296)
==31861==    by 0x134CBB24: wxGridTypeRegistry::FindOrCloneDataType(wxString const&) (grid.cpp:9302)
==31861==    by 0x134C7935: wxGrid::GetDefaultEditorForType(wxString const&) const (grid.cpp:8002)

So, it happens that when the editor's .Clone() is called from within wxGridTypeRegistry::FindOrCloneDataType(), the cloned object is immediately destroyed, and the application segfaults. Also, if a reference to the cloned object is stored somewhere, everything works just fine.

When run, the following is printed:

EDITOR <__main__.MyGridCellEditor object at 0x7f2463b1b948>
CLONE <__main__.MyGridCellEditor object at 0x7f2463b1b948> <__main__.MyGridCellEditor object at 0x7f2463b1b9d8>
DELETE <__main__.MyGridCellEditor object at 0x7f2463b1b9d8> 1
Segmentation fault (core dumped)

so it can be seen that the object destroyed is the cloned one, not the original.

FindFirst does not work as expected in MemoryFSHandler.

When I call FindFirst via Python using wxPython I will always get an empty string. In contrast when I call the function using C++ the code works as expected. This leads me to believe that the issue is in the wrapper between the C++ and Python code.

I am comparing wxWidgets 3.1 compiled using Visual Studio 2015 Community Edition with 3.0.3.dev2546+8e6609a msw (phoenix). If the program failed I the error message generated by the assert will be seen, otherwise nothing will happen which is the expected behavior.

Here are minimal examples demonstrating the difference.

C++ code:

#include <assert.h>
#include "wx/wxprec.h"

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include "wx/wx.h"
#endif

#include "wx/filesys.h"
#include "wx/fs_mem.h"


class TestApp : public wxApp
{
public:
    TestApp()
    {
    }

    virtual bool OnInit() wxOVERRIDE;
};
wxIMPLEMENT_APP(TestApp);
bool TestApp::OnInit()
{
    if (!wxApp::OnInit())
        return false;

    auto memoryFS = new wxMemoryFSHandler;
    wxFileSystem::AddHandler(memoryFS);

    memoryFS->AddFile("test.txt","This is a test");
    wxString spec = wxString("test.txt");
    wxString found = memoryFS->FindFirst(spec);
    assert(found.IsSameAs(wxString("test.txt")));
    wxFileSystem::RemoveHandler(memoryFS);
    delete memoryFS;

    return false;//Returns false in order to make the program exit immediately after running this test.
}

Python code:

import wx

wx.App()

memoryFS = wx.MemoryFSHandler()
wx.FileSystem.AddHandler(memoryFS)

memoryFS.AddFile('test.txt','This is a test')
found = memoryFS.FindFirst('test.txt')
assert(found == 'test.txt')

wx.FileSystem.RemoveHandler(memoryFS)

GridSizer doesn't work in a nested panel

I encountered the issue when trying to manually place a panel inside other panel(using "pos", "size") and then setting a sizer for the inner panel. The controls added to the sizer are one over another. I reproduced the buggy behaviour using mainloop sample, see the attachment. Hmm.. . don't see an "add attachmnent" option here so I paste code below.

System: Windows 10 64 bit, python 3

#!/usr/bin/env python

"""
This demo attempts to override the C++ MainLoop and implement it
in Python.
"""

import time
import wx

##import os; raw_input('PID: %d\nPress enter...' % os.getpid())

#---------------------------------------------------------------------------

class MyFrame(wx.Frame):

    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title,
                         (100, 100), (160, 150))

        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_MOVE, self.OnMove)
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
        self.Bind(wx.EVT_IDLE, self.OnIdle)

        self.count = 0

        panel1 = wx.Panel(self)
		
		# adding a nested panel		
        panel = wx.Panel(panel1, pos = wx.Point(10, 10), size = wx.Size(100, 100))
		
        sizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5)

        self.sizeCtrl = wx.TextCtrl(panel, -1, "", style=wx.TE_READONLY)
        sizer.Add(wx.StaticText(panel, -1, "Size:"))
        sizer.Add(self.sizeCtrl)

        self.posCtrl = wx.TextCtrl(panel, -1, "", style=wx.TE_READONLY)
        sizer.Add(wx.StaticText(panel, -1, "Pos:"))
        sizer.Add(self.posCtrl)

        self.idleCtrl = wx.TextCtrl(panel, -1, "", style=wx.TE_READONLY)
        sizer.Add(wx.StaticText(panel, -1, "Idle:"))
        sizer.Add(self.idleCtrl)

        panel.SetSizer(sizer)


    def OnCloseWindow(self, event):
        self.Destroy()

    def OnIdle(self, event):
        self.idleCtrl.SetValue(str(self.count))
        self.count = self.count + 1

    def OnSize(self, event):
        size = event.GetSize()
        self.sizeCtrl.SetValue("%s, %s" % (size.width, size.height))
        event.Skip()

    def OnMove(self, event):
        pos = event.GetPosition()
        self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))



#---------------------------------------------------------------------------

class MyEventLoop(wx.GUIEventLoop):
    def __init__(self):
        wx.GUIEventLoop.__init__(self)
        self.exitCode = 0
        self.shouldExit = False


    def DoMyStuff(self):
        # Do whatever you want to have done for each iteration of the event
        # loop. In this example we'll just sleep a bit to simulate something
        # real happening.
        time.sleep(0.10)


    def Run(self):
        # Set this loop as the active one. It will automatically reset to the
        # original evtloop when the context manager exits.
        with wx.EventLoopActivator(self):
            while True:

                self.DoMyStuff()

                # Generate and process idles events for as long as there
                # isn't anything else to do
                while not self.shouldExit and not self.Pending() and self.ProcessIdle():
                    pass

                if self.shouldExit:
                    break

                # dispatch all the pending events and call Dispatch() to wait
                # for the next message
                if not self.ProcessEvents():
                    break

                # Currently on wxOSX Pending always returns true, so the
                # ProcessIdle above is not ever called. Call it here instead.
                if 'wxOSX' in wx.PlatformInfo:
                    self.ProcessIdle()

            # Proces remaining queued messages, if any
            while True:
                checkAgain = False
                if wx.GetApp() and wx.GetApp().HasPendingEvents():
                    wx.GetApp().ProcessPendingEvents()
                    checkAgain = True
                if 'wxOSX' not in wx.PlatformInfo and self.Pending():
                    self.Dispatch()
                    checkAgain = True
                if not checkAgain:
                    break

        return self.exitCode


    def Exit(self, rc=0):
        self.exitCode = rc
        self.shouldExit = True
        self.OnExit()
        self.WakeUp()


    def ProcessEvents(self):
        if wx.GetApp():
            wx.GetApp().ProcessPendingEvents()

        if self.shouldExit:
            return False

        return self.Dispatch()





class MyApp(wx.App):

    def MainLoop(self):
        self.SetExitOnFrameDelete(True)
        self.mainLoop = MyEventLoop()
        self.mainLoop.Run()

    def ExitMainLoop(self):
        self.mainLoop.Exit()

    def OnInit(self):
        frame = MyFrame(None, -1, "This is a test")
        frame.Show(True)
        self.SetTopWindow(frame)

        #self.keepGoing = True
        return True


app = MyApp(False)
app.MainLoop()

ListCtrl scrollbar dark corner and sometimes issues with tearing

I am not sure if this is normal behavior but it looks a little strange to me or a mistake with my code?

os: Windows 10 64bit,
version: '3.0.3.dev2445+ca34d71 msw (phoenix)'
ide: spyder ( Anaconda 64bit)

code (just a listctrl in a standard frame):

import wx

class Frame(wx.Frame):

    def __init__(self, title):
        wx.Frame.__init__(self, None, title=title)

        panel = wx.Panel(self)
        sizer = wx.BoxSizer(wx.HORIZONTAL)

        lc = wx.ListCtrl(panel, style=wx.LC_REPORT)
        lc.InsertColumn(0, "column 1")
        lc.InsertColumn(1, "column 2")
        for x in range(0, 100):
            lc.Append([str(x), str(x)])
        sizer.Add(lc, 1, wx.ALL|wx.EXPAND, 5)

        panel.SetSizer(sizer)

app = wx.App()
frame = Frame(title="list issue")
frame.Show()
app.MainLoop()

The issues:

  • when I drag the vertical scroll bar and release the mouse button, it leaves a dark rectangle on the scroll bar.

list

  • I have also had issues with "tearing" where the listctrl partially disappears. This happens randomly when dragging the scrollbar. I have to rerun the code a number of times in order to reproduce this particular problem

tearing

Build Python2 and Python3 modules in same dir -> Py2 extensions get installed for Py3

Is building Py2 and Py3 modules in the same directory supposed to work?

When I do so, I end up with the Py2 modules getting installed into the Py3 directory (in addition to the Py3 modules):

[talbert@easel wxPython_Phoenix-3.0.3.dev1976+d9956d6]$ find . -name _core*.so
./wx/_core.cpython-34m.so
./wx/_core.so
./build/waf/2.7/_core.so
./build/waf/3.4/_core.cpython-34m.so
./build/lib.linux-x86_64-3.4/wx/_core.cpython-34m.so
./build/lib.linux-x86_64-3.4/wx/_core.so
./build/lib.linux-x86_64-2.7/wx/_core.so

I think this is because the .so's get copied from build/waf// to wx/ and then wx/* gets bulk copied to the install dir. I can't for the life of me see where in the code this is happening, though.

Broken wx.adv

Just compiled latest merge (14a1ddd) in Fedora 22 x64 GTK3, and the demo.py is failing with wx.adv module.

[helio@localhost demo]$ ./demo.py 
Traceback (most recent call last):
  File "./demo.py", line 3, in <module>
    import Main
  File "/opt/Phoenix/demo/Main.py", line 62, in <module>
    import wx.adv
  File "/usr/lib64/python2.7/site-packages/wx-3.0.3-dev-gtk3/wx/adv.py", line 6, in <module>
    from ._adv import *
ImportError: /usr/lib64/python2.7/site-packages/wx-3.0.3-dev-gtk3/wx/_adv.so: symbol _ZTI21wxNotificationMessage, version WXU_3.0 not defined in file libwx_gtk3u_adv-3.0.so.0 with link time reference

(Some demos launch fine, for example: RearrangeDialog.py and FontDialog.py)

Unit tests are failing!

[helio@localhost Phoenix]$ ./b test
/usr/bin/python
Build using: "/usr/bin/python"
2.7.10 (default, Sep 24 2015, 17:50:09) 
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)]
Python's architecture is 64bit
cfg.VERSION: 3.0.3

Running command: test
"/usr/bin/python" unittests/runtests.py  
wx.version: 3.0.3 gtk3 (phoenix)
pid: 27597
Traceback (most recent call last):
  File "unittests/runtests.py", line 162, in <module>
    testRunner=MyTestRunner, testLoader=MyTestLoader())
  File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib64/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib64/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/opt/Phoenix/unittests/test_lib_agw_balloontip.py", line 5, in <module>
    import wx.lib.agw.balloontip as BT
  File "/usr/lib64/python2.7/site-packages/wx-3.0.3-dev-gtk3/wx/lib/agw/balloontip.py", line 171, in <module>
    import wx.adv
  File "/usr/lib64/python2.7/site-packages/wx-3.0.3-dev-gtk3/wx/adv.py", line 6, in <module>
    from ._adv import *
ImportError: /usr/lib64/python2.7/site-packages/wx-3.0.3-dev-gtk3/wx/_adv.so: symbol _ZTI21wxNotificationMessage, version WXU_3.0 not defined in file libwx_gtk3u_adv-3.0.so.0 with link time reference
Command '"/usr/bin/python" unittests/runtests.py  ' failed with exit code 1.
Finished command: test (2.179s)
Done!

@RobinD42 please tell me how can I help.

Exception when running Demo ShortcutEditor

Using latest git version, I am getting the below exception (DoShowScrollbars(): window must be created):

19:20:25: Debug: Invalid key string "f21"
19:20:25: Debug: Unrecognized accel key 'f21', accel string ignored.
19:20:25: Debug: Invalid key string "f21"
19:20:25: Debug: Unrecognized accel key 'f21', accel string ignored.
19:20:25: Debug: Unrecognized accel key 'start', accel string ignored.
19:20:25: Debug: Invalid key string "f24"
19:20:25: Debug: Unrecognized accel key 'f24', accel string ignored.
19:20:25: Debug: Invalid key string "f17"
19:20:25: Debug: Unrecognized accel key 'f17', accel string ignored.
Traceback (most recent call last):
  File "agw/ShortcutEditor.py", line 380, in OnButton1
    self.win = ShortcutEditorDemo(self, self.log)
  File "agw/ShortcutEditor.py", line 168, in __init__
    dlg = SE.ShortcutEditor(self)
  File "/opt/Phoenix/wx/lib/agw/shortcuteditor.py", line 2214, in __init__
    self.CreateWidgets()
  File "/opt/Phoenix/wx/lib/agw/shortcuteditor.py", line 2236, in CreateWidgets
    self.listShortcut = ListShortcut(self)
  File "/opt/Phoenix/wx/lib/agw/shortcuteditor.py", line 1694, in __init__
    wx.TR_FULL_ROW_HIGHLIGHT|HTL.TR_ELLIPSIZE_LONG_ITEMS)
  File "/opt/Phoenix/wx/lib/agw/hypertreelist.py", line 4169, in __init__
    self._main_win = TreeListMainWindow(self, -1, wx.Point(0, 0), size, main_style, agwStyle, validator)
  File "/opt/Phoenix/wx/lib/agw/hypertreelist.py", line 2075, in __init__
    CustomTreeCtrl.__init__(self, parent, id, pos, size, style, agwStyle, validator, name)
  File "/opt/Phoenix/wx/lib/agw/customtreectrl.py", line 2820, in __init__
    wx.ScrolledWindow.__init__(self, parent, id, pos, size, style|wx.HSCROLL|wx.VSCROLL, name)
wx._core.wxAssertionError: C++ assertion "scrolled" failed at /opt/Phoenix/ext/wxWidgets/src/gtk/scrolwin.cpp(227) in DoShowScrollbars(): window must be created

Attached image

shortcuteditor_nok_f780b216881e6afd81584ae49453630734e023c5

This problem was not happening with a previous snapshot (dev1851_eedf718). Attached image
shortcuteditor_ok_dev1851_eedf718

I am porting RIDE from Classic to Phoenix and this issue is BLOCKING my progress, because Tree Panel cannot be created and main frame depends heavily on it. If anyone wants to try my RIDE fork (compatible with 2.8.12.1, 2.9.5, 3.0.2 and Phoenix) it is here.
@RobinD42 how can I help debugging/fixing this? Thanks.

My system is Fedora Core 22 x64 with Python 2.7.10

SIP 4.18 build problems - vscroll multiple inheritance ambiguity

Phoenix doesn't build with SIP 4.18. It seems that SIP changed the way that it generates its type cast functions (in the case of multiple inheritance), resulting in compile errors:

[185/720] cxx: sip/cpp/sip_corewxHeaderButtonParams.cpp -> build/waf/2.7/sip/cpp/sip_corewxHeaderButtonParams.cpp.3.o
../../../sip/cpp/sip_corewxHVScrolledWindow.cpp: In function 'void* cast_wxHVScrolledWindow(void*, const sipTypeDef*)':
../../../sip/cpp/sip_corewxHVScrolledWindow.cpp:2900:59: error: 'wxVarScrollHelperBase' is an ambiguous base of 'wxHVScrolledWindow'
         return static_cast<wxVarScrollHelperBase *>(sipCpp);
                                                           ^
../../../sip/cpp/sip_corewxHVScrolledWindow.cpp:2906:59: error: 'wxVarScrollHelperBase' is an ambiguous base of 'wxHVScrolledWindow'
         return static_cast<wxVarScrollHelperBase *>(sipCpp);
                                                           ^

The problem seems like it could be avoided in SIP itself (by checking for duplicate base types), but other than that, I don't see a way around it other than editing the generated SIP code. I'll prepare a patch to do that for now. (I had originally thought this was a GCC 6.1.1 problem, but I failed to notice that SIP had changed too.)

Font sizes incorrect using wx.GraphicsContext under Windows

With wx.lib.pdfviewer under Windows when using wx.GraphicsContext or Cairo.GraphicsContext I have had to apply a scale factor to the font sizes in the ratio of points-per-inch/screen-pixels-per inch (normally 72/96 = 0.75) as the fonts come out too big in some circumstances. However the scaling affects the wx.Font.PointSize, which can only take integer values. In my own application the original fonts are nearly all 12 point, which scales exactly to 9 point but when, for example, text is 10 point (-> 7.5) it can only be scaled to 8 point (too big) or 7 point (too small).

In general, the scaling needs to be applied to gc.SetFont which sets the font size and dc.GetFullTextExtent which returns the font metrics. The behaviour of wx.GraphicsContext and Cairo.GraphicsContext are slightly different:

wx.GraphicsContext requires scaling applied to both SetFont and GetFullTextExtent when rendering either to a screen or to a printer DC.

Cairo.GraphicsContext requires scaling applied only to GetFullTextExtent when rendering to a screen DC but to both SetFont and GetFullTextExtent when rendering to a printer DC.

It is not necessary to apply any sort of scaling when using OS X. Is there any advice on how this problem might best be addressed so that no scaling is required under Windows?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.