Compiling wxPython 2.4.2 on Panther

Hi all,

I'm trying to get a Panther build of wxPython going, but I'm having a problem when compiling the wxPython extensions. When I pull the latest CVS off the WX_2_4_BRANCH and compile wxPython, I get the following error:

src/mac/controls.cpp: In function `void wxComboBox_Append(wxComboBox*, const
    wxString&, PyObject*)':
src/mac/controls.cpp:3587: error: no matching function for call to `wxComboBox
    ::Append(const wxString&, wxPyClientData*&)'
/usr/local/include/wx/mac/combobox.h:68: error: candidates are: virtual void
    wxComboBox::Append(const wxString&)
error: command 'gcc' failed with exit status 1

Sure enough, I can't find a wxComboBox::Append(const wxString&, void *) anywhere in the mac/combobox.h header, although it does have the Append(wxString&) function listed. In wx2.5 sources, ComboBox and Choice are derived off of wxControlWithItems, which defines both Append functions.

Since this isn't really a Panther-specific error, I wanted to ask if there have been some recent changes to wxComboBox or the wxPython SWIG files on the wx2.4 branch that could cause this error to occur. Let me know if I should send this along to wx-dev. =)

Thanks,

Kevin

Kevin Ollivier wrote:

Hi all,

I'm trying to get a Panther build of wxPython going, but I'm having a problem when compiling the wxPython extensions. When I pull the latest CVS off the WX_2_4_BRANCH and compile wxPython, I get the following error:

src/mac/controls.cpp: In function `void wxComboBox_Append(wxComboBox*, const
   wxString&, PyObject*)':
src/mac/controls.cpp:3587: error: no matching function for call to `wxComboBox
   ::Append(const wxString&, wxPyClientData*&)'
/usr/local/include/wx/mac/combobox.h:68: error: candidates are: virtual void
   wxComboBox::Append(const wxString&)
error: command 'gcc' failed with exit status 1

Sure enough, I can't find a wxComboBox::Append(const wxString&, void *) anywhere in the mac/combobox.h header, although it does have the Append(wxString&) function listed. In wx2.5 sources, ComboBox and Choice are derived off of wxControlWithItems, which defines both Append functions.

Since this isn't really a Panther-specific error, I wanted to ask if there have been some recent changes to wxComboBox or the wxPython SWIG files on the wx2.4 branch that could cause this error to occur. Let me know if I should send this along to wx-dev. =)

There are a few patches to the 2.4 code that I made for wxPython. They were done to workaround a few issues that couldn't be fixed in the CVS because of binary compatibility. If you get the wxPythonSrc tarball the patches are in the wxPython/patches dir.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Kevin Ollivier wrote:

Hi all,
I'm trying to get a Panther build of wxPython going, but I'm having a problem when compiling the wxPython extensions. When I pull the latest CVS off the WX_2_4_BRANCH and compile wxPython, I get the following error:
src/mac/controls.cpp: In function `void wxComboBox_Append(wxComboBox*, const
   wxString&, PyObject*)':
src/mac/controls.cpp:3587: error: no matching function for call to `wxComboBox
   ::Append(const wxString&, wxPyClientData*&)'
/usr/local/include/wx/mac/combobox.h:68: error: candidates are: virtual void
   wxComboBox::Append(const wxString&)
error: command 'gcc' failed with exit status 1
Sure enough, I can't find a wxComboBox::Append(const wxString&, void *) anywhere in the mac/combobox.h header, although it does have the Append(wxString&) function listed. In wx2.5 sources, ComboBox and Choice are derived off of wxControlWithItems, which defines both Append functions.
Since this isn't really a Panther-specific error, I wanted to ask if there have been some recent changes to wxComboBox or the wxPython SWIG files on the wx2.4 branch that could cause this error to occur. Let me know if I should send this along to wx-dev. =)

There are a few patches to the 2.4 code that I made for wxPython. They were done to workaround a few issues that couldn't be fixed in the CVS because of binary compatibility. If you get the wxPythonSrc tarball the patches are in the wxPython/patches dir.

Thanks, that did the trick! I'm going through the demo, and if all goes well I'll see if I can modify the installer to point to /System/Library and post the new installer online. I could post directly to SF if you want (though you would have to move it to the wxPython releases page), or I can put it in a 'preview release' page on my site (as you do with prototypes) and we can go from there.

Kevin

···

On Nov 3, 2003, at 8:08 AM, Robin Dunn wrote:

Hi Robin,

One more question - what is the set of options you pass into /wxPython/distrib/mac/buildpkg.py?

Thanks,

Kevin

···

On Nov 3, 2003, at 12:26 PM, Kevin Ollivier wrote:

Hi Robin,

On Nov 3, 2003, at 8:08 AM, Robin Dunn wrote:

Kevin Ollivier wrote:

Hi all,
I'm trying to get a Panther build of wxPython going, but I'm having a problem when compiling the wxPython extensions. When I pull the latest CVS off the WX_2_4_BRANCH and compile wxPython, I get the following error:
src/mac/controls.cpp: In function `void wxComboBox_Append(wxComboBox*, const
   wxString&, PyObject*)':
src/mac/controls.cpp:3587: error: no matching function for call to `wxComboBox
   ::Append(const wxString&, wxPyClientData*&)'
/usr/local/include/wx/mac/combobox.h:68: error: candidates are: virtual void
   wxComboBox::Append(const wxString&)
error: command 'gcc' failed with exit status 1
Sure enough, I can't find a wxComboBox::Append(const wxString&, void *) anywhere in the mac/combobox.h header, although it does have the Append(wxString&) function listed. In wx2.5 sources, ComboBox and Choice are derived off of wxControlWithItems, which defines both Append functions.
Since this isn't really a Panther-specific error, I wanted to ask if there have been some recent changes to wxComboBox or the wxPython SWIG files on the wx2.4 branch that could cause this error to occur. Let me know if I should send this along to wx-dev. =)

There are a few patches to the 2.4 code that I made for wxPython. They were done to workaround a few issues that couldn't be fixed in the CVS because of binary compatibility. If you get the wxPythonSrc tarball the patches are in the wxPython/patches dir.

Thanks, that did the trick! I'm going through the demo, and if all goes well I'll see if I can modify the installer to point to /System/Library and post the new installer online. I could post directly to SF if you want (though you would have to move it to the wxPython releases page), or I can put it in a 'preview release' page on my site (as you do with prototypes) and we can go from there.

Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-dev-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-dev-help@lists.wxwindows.org

Kevin Ollivier wrote:

Thanks, that did the trick!

Good.

I'm going through the demo, and if all goes well I'll see if I can
modify the installer to point to /System/Library

It should all be in the wxPython/distrib/mac/wxPythonOSX/build script,
and it shouldn't be too hard to make it conditional which python it uses
and which location it uses for site-packages, so it could still work the
way it currently does.

and post the new installer online. I could post directly to SF if you
want (though you would have to move it to the wxPython releases
page), or I can put it in a 'preview release' page on my site (as you
do with prototypes) and we can go from there.

Either way is fine with me.

Kevin Ollivier wrote:

Hi Robin,

One more question - what is the set of options you pass into /wxPython/distrib/mac/buildpkg.py?

As mentioned above you need to use wxPython/distrib/mac/wxPythonOSX/build, and it will then use buildpkg.py. You probably want to use command-line options something like "2.4.2.4-panther 2.3 use_cvs" You may also need to to tweak it a bit to fully specify which version of Python to use to make the build and so forth.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Kevin Ollivier wrote:

Thanks, that did the trick!

Good.

I'm going through the demo, and if all goes well I'll see if I can
modify the installer to point to /System/Library

It should all be in the wxPython/distrib/mac/wxPythonOSX/build script,
and it shouldn't be too hard to make it conditional which python it uses
and which location it uses for site-packages, so it could still work the
way it currently does.

Great! I tested my build and everything went smoothly, the only glitch I noticed aside from visual ones (Panther requires different spacing/borders for controls... <sigh>) is that wxPopupControl seems to be freezing the interface after the calendar control pops up. I had to force quit. Are you seeing this on Jaguar? (Unless you've upgraded too, then are you seeing this on Panther? =) It's not a critical show-stopper or anything but I thought I'd mention it in case you had any thoughts.

Also, during the build process I came across one issue (so far) that I thought I should ask you about:

The wxPython binaries have debug info in them which increases their size quite a bit. I'm not specifying a debug flag and I didn't build wxWindows debug, so there is something else I need to do apparently. I know the debug info is gone from the latest OS X builds - did you do so by setting UNDEF_NDEBUG to 0 in setup.py? I know I could 'try it and see', but I figure double-checking to make sure I'm doing the right thing wouldn't hurt. =)

and post the new installer online. I could post directly to SF if you
want (though you would have to move it to the wxPython releases
page), or I can put it in a 'preview release' page on my site (as you
do with prototypes) and we can go from there.

Either way is fine with me.

After thinking about this, I'll probably put this on my own server first. It is probably safer to get some independent confirmation before posting it to SF. :wink:

Kevin Ollivier wrote:

Hi Robin,
One more question - what is the set of options you pass into /wxPython/distrib/mac/buildpkg.py?

As mentioned above you need to use wxPython/distrib/mac/wxPythonOSX/build, and it will then use buildpkg.py. You probably want to use command-line options something like "2.4.2.4-panther 2.3 use_cvs" You may also need to to tweak it a bit to fully specify which version of Python to use to make the build and so forth.

Yep, I think I've gotten this all worked out. =) Once I know for sure what I should do to remove the debug info from the binaries, I should be ready to post an installer for testing. Should happen tomorrow or Wednesday, depending on how long my homework takes. :wink:

BTW, Panther's support for Python is excellent - the complete Framework build is here, right down to PythonLauncher and the pythonw script! Why they had to go muck with tabs is beyond me though... The new tabs look very close to a wxPanel (rounded rect) with a series of buttons near the top. They look cool but they do break a number of uses of tabs, including the use of tabs to host a control. It doesn't look smooth. They're really only suitable for hosting dialogs/forms. Oh well... Nothing we can do now except adapt. ^_^;

Thanks,

Kevin

···

On Nov 3, 2003, at 5:14 PM, Robin Dunn wrote:

Kevin Ollivier wrote:

Great! I tested my build and everything went smoothly, the only glitch I noticed aside from visual ones (Panther requires different spacing/borders for controls... <sigh>) is that wxPopupControl seems to be freezing the interface after the calendar control pops up. I had to force quit. Are you seeing this on Jaguar? (Unless you've upgraded too, then are you seeing this on Panther? =) It's not a critical show-stopper or anything but I thought I'd mention it in case you had any thoughts.

It has happened before, but I thought it was fixed. I'll check into it again.

Also, during the build process I came across one issue (so far) that I thought I should ask you about:

The wxPython binaries have debug info in them which increases their size quite a bit. I'm not specifying a debug flag and I didn't build wxWindows debug, so there is something else I need to do apparently. I know the debug info is gone from the latest OS X builds - did you do so by setting UNDEF_NDEBUG to 0 in setup.py? I know I could 'try it and see', but I figure double-checking to make sure I'm doing the right thing wouldn't hurt. =)

This is a stupid little side effect of how distutils works on unix-like systems. The default compiler flags that it compiles extension modules with are taken from the Makefile that was used to build Python, even if they would contradict what flags are given (or not given) to setup.py. So look in the Python Framework in usr/lib/python2.3/config/Makefile for the setting for OPT. Looking at mine I see that I removed both -g and -O3. In wxPython's setup.py I add -g and -O0 if --debug is given and -O3 if it is not.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Your suggestions (as always ) were right on the money and I've trimmed the DMG size down by half, and all seems to be running smoothly, aside from the wxPopupControl issue. BTW, it is an issue of focus - when you click the button the popup control appears and gains the focus, but then the main window becomes unable to regain the focus. The issue can be resolved by right-clicking on the demo icon in the dock and re-selecting the main window.

There was one other issue, with XRCEd - the getopts code is failing because Python is adding extra arguments, and although you've written code so that on Mac it is not a fatal error, opts never properly gets assigned a value. Which leads to the following:

Traceback (most recent call last):
   File "/Applications/wxPythonOSX-2.4.2.4-panther/XRCed.app/Contents/Resources/xrced.py", line 4, in ?
     main()
   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython/tools/XRCed/xrced.py", line 989, in main
     app = App(0, useBestVisual=False)
   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython/wx.py", line 1951, in __init__
     _wxStart(self.OnInit)
   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython/tools/XRCed/xrced.py", line 923, in OnInit
     for o,a in opts:
UnboundLocalError: local variable 'opts' referenced before assignment

What I didn't know is - is it OK to skip command line handling on Mac, at least when run from a .app bundle? Since the only option that affects performance would be -d, I would think skipping arg handling on Mac might be a reasonable solution here. Maybe add an argument to main() like fromBundle=True or noCommandLine=True. What do you think?

Thanks,

Kevin

···

On Nov 4, 2003, at 10:09 AM, Robin Dunn wrote:

Kevin Ollivier wrote:

Great! I tested my build and everything went smoothly, the only glitch I noticed aside from visual ones (Panther requires different spacing/borders for controls... <sigh>) is that wxPopupControl seems to be freezing the interface after the calendar control pops up. I had to force quit. Are you seeing this on Jaguar? (Unless you've upgraded too, then are you seeing this on Panther? =) It's not a critical show-stopper or anything but I thought I'd mention it in case you had any thoughts.

It has happened before, but I thought it was fixed. I'll check into it again.

Also, during the build process I came across one issue (so far) that I thought I should ask you about:
The wxPython binaries have debug info in them which increases their size quite a bit. I'm not specifying a debug flag and I didn't build wxWindows debug, so there is something else I need to do apparently. I know the debug info is gone from the latest OS X builds - did you do so by setting UNDEF_NDEBUG to 0 in setup.py? I know I could 'try it and see', but I figure double-checking to make sure I'm doing the right thing wouldn't hurt. =)

This is a stupid little side effect of how distutils works on unix-like systems. The default compiler flags that it compiles extension modules with are taken from the Makefile that was used to build Python, even if they would contradict what flags are given (or not given) to setup.py. So look in the Python Framework in usr/lib/python2.3/config/Makefile for the setting for OPT. Looking at mine I see that I removed both -g and -O3. In wxPython's setup.py I add -g and -O0 if --debug is given and -O3 if it is not.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-dev-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-dev-help@lists.wxwindows.org

Kevin Ollivier wrote:

There was one other issue, with XRCEd - the getopts code is failing because Python is adding extra arguments, and although you've written code so that on Mac it is not a fatal error, opts never properly gets assigned a value. Which leads to the following:

Traceback (most recent call last):
  File "/Applications/wxPythonOSX-2.4.2.4-panther/XRCed.app/Contents/ Resources/xrced.py", line 4, in ?
    main()
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/wxPython/tools/XRCed/xrced.py", line 989, in main
    app = App(0, useBestVisual=False)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/wxPython/wx.py", line 1951, in __init__
    _wxStart(self.OnInit)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/wxPython/tools/XRCed/xrced.py", line 923, in OnInit
    for o,a in opts:
UnboundLocalError: local variable 'opts' referenced before assignment

What I didn't know is - is it OK to skip command line handling on Mac, at least when run from a .app bundle?

Sure.

Since the only option that affects performance would be -d, I would think skipping arg handling on Mac might be a reasonable solution here. Maybe add an argument to main() like fromBundle=True or noCommandLine=True. What do you think?

Whichever way works best. Send me a patch.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!