2.9.1.1 20100922 Preview

Hi All,

After yet another round of resolving quirky build issues, I've made a preview build of 2.9.1.1 that is ready for you to take a look at and to try out.

URL: http://wxpython.wxcommunity.com/preview/20100922/
Changes: http://wxpython.wxcommunity.com/preview/20100922/CHANGES.html

Probably the most notable change in this release is the addition of the OSX-Cocoa build, including a 64-bit architecture in the fat binaries. The Cocoa port requires at least OSX 10.5, and the Carbon port requires 10.4 or better. There are still some rough edges in the Cocoa port, but a lot does work and works well. If you run into issues that seem to be Cocoa specific then be sure to create tickets for them at http://trac.wxwidgets.org with the component set to wxOSX-Cocoa, after having searched for any existing tickets for the same issue of course.

I just realized that I didn't do anything to try and make the Carbon and Cocoa builds be able to coexist, so it is highly unlikely that it will work. You'll need to either uninstall/reinstall if you want to go back and forth between the ports, or you can do something like install the Carbon version for Python 2.6 and the Cocoa version for 2.7.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org

Hi Robin,

Hi All,

After yet another round of resolving quirky build issues, I've made a
preview build of 2.9.1.1 that is ready for you to take a look at and to try
out.

URL: NameBright - Coming Soon
Changes: NameBright - Coming Soon

Probably the most notable change in this release is the addition of the
OSX-Cocoa build, including a 64-bit architecture in the fat binaries. The
Cocoa port requires at least OSX 10.5, and the Carbon port requires 10.4 or
better. There are still some rough edges in the Cocoa port, but a lot does
work and works well. If you run into issues that seem to be Cocoa specific
then be sure to create tickets for them at http://trac.wxwidgets.org with
the component set to wxOSX-Cocoa, after having searched for any existing
tickets for the same issue of course.

I just realized that I didn't do anything to try and make the Carbon and
Cocoa builds be able to coexist, so it is highly unlikely that it will work.
You'll need to either uninstall/reinstall if you want to go back and forth
between the ports, or you can do something like install the Carbon version
for Python 2.6 and the Cocoa version for 2.7.

Thank you for the preview, the new functionalities and widgets are
very nice. I have found few issues up to now:

1) The main wxPython demo and all the sub-demos which require a
separate frame to run and for which an icon is set with SetIcon, fail
with the following message:

Traceback (most recent call last):
  File "agw\RulerCtrl.py", line 434, in OnButton
    self.win = RulerCtrlDemo(self, self.log)
  File "agw\RulerCtrl.py", line 146, in __init__
    self.SetIcon(images.Mondrian.GetIcon())
  File "C:\Python25\Lib\site-packages\wx-2.9.1-msw\wx\_windows.py",
line 443, in SetIcon
    return _windows_.TopLevelWindow_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\msw\toplevel.cpp(1079) in wxTopLevelWindowMSW::SetIcons():
icon bundle doesn't contain any suitable icon

I had reported this error after the previous pre-release (2.9.0.1) as well.

2) The Unicode, MimeTypesManager, Joystick, I18N, TreeMixin and
TreeListCtrl demos fail with the attached error message
"wxPythonAssert.png";
3) The BitmapComboBox demo is a bit too shrunk to display the selected
item (see attached "BCB.png");
4) MediaCtrl demo crashes at startup with the attached unhandled
exception "MediaCtrl.png".

I'll report back if I find any other issue.

This is on Windows 7 64 bit, Python 2.5.4 32 bit.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 23 September 2010 20:24, Robin Dunn wrote:

Hi Robin,

1) The main wxPython demo and all the sub-demos which require a
separate frame to run and for which an icon is set with SetIcon, fail
with the following message:

Traceback (most recent call last):
   File "agw\RulerCtrl.py", line 434, in OnButton
     self.win = RulerCtrlDemo(self, self.log)
   File "agw\RulerCtrl.py", line 146, in __init__
     self.SetIcon(images.Mondrian.GetIcon())
   File "C:\Python25\Lib\site-packages\wx-2.9.1-msw\wx\_windows.py",
line 443, in SetIcon
     return _windows_.TopLevelWindow_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\msw\toplevel.cpp(1079) in wxTopLevelWindowMSW::SetIcons():
icon bundle doesn't contain any suitable icon

I had reported this error after the previous pre-release (2.9.0.1) as well.

I've back-ported the fix for this from the trunk. The code for setting the icon was changed to look for an exact match in the icon of the size preferred by the OS. For Windows after XP that can be anything from 32 to 128. On my Windows7 box it wanted icons that were an odd size of 40x40! The patch relaxes the size check and doesn't fail if an exact match is not found.

2) The Unicode, MimeTypesManager, Joystick, I18N, TreeMixin and
TreeListCtrl demos fail with the attached error message
"wxPythonAssert.png";

Hmmm... Apparently the font family of the default font fetched from a panel is not known. I'll ask if this is expected, but in the meantime it's not too hard to check the family before using it, or to construct the fonts a different way.

Update: It's a known bug. wxTrac has been migrated to GitHub Issues - wxWidgets I'll hack the proposed fix into my 2.9.1.1 branch.

3) The BitmapComboBox demo is a bit too shrunk to display the selected
item (see attached "BCB.png");

Please create a ticket for this one, with component set to wxMSW. It seems that no matter what the size is set to the height is being reset to 19 by something, and that is not tall enough to draw the default font.

4) MediaCtrl demo crashes at startup with the attached unhandled
exception "MediaCtrl.png".

No crashes for me, however on Win7 the Play button is not enabled so there may be some changes in how Windows sends the events. On XP it works fine.

I'll report back if I find any other issue.

Thanks for your help.

···

On 9/23/10 2:01 PM, Andrea Gavana wrote:

--
Robin Dunn
Software Craftsman

Hi Robin,

1) The main wxPython demo and all the sub-demos which require a
separate frame to run and for which an icon is set with SetIcon, fail
with the following message:

Traceback (most recent call last):
File "agw\RulerCtrl.py", line 434, in OnButton
self.win = RulerCtrlDemo(self, self.log)
File "agw\RulerCtrl.py", line 146, in __init__
self.SetIcon(images.Mondrian.GetIcon())
File "C:\Python25\Lib\site-packages\wx-2.9.1-msw\wx\_windows.py",
line 443, in SetIcon
return _windows_.TopLevelWindow_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\msw\toplevel.cpp(1079) in wxTopLevelWindowMSW::SetIcons():
icon bundle doesn't contain any suitable icon

I had reported this error after the previous pre-release (2.9.0.1) as
well.

I've back-ported the fix for this from the trunk. The code for setting the
icon was changed to look for an exact match in the icon of the size
preferred by the OS. For Windows after XP that can be anything from 32 to
128. On my Windows7 box it wanted icons that were an odd size of 40x40!
The patch relaxes the size check and doesn't fail if an exact match is not
found.

Thank you for the fix.

3) The BitmapComboBox demo is a bit too shrunk to display the selected
item (see attached "BCB.png");

Please create a ticket for this one, with component set to wxMSW. It seems
that no matter what the size is set to the height is being reset to 19 by
something, and that is not tall enough to draw the default font.

Done, ticket #12515.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 24 September 2010 22:30, Robin Dunn wrote:

On 9/23/10 2:01 PM, Andrea Gavana wrote:

Hi,

I downloaded the runtime version for Py 2.7 and installed it
on Windows 7, 32 bits, without problem.

The next step was a test with my interactive Python interpreter,
psi. I already have a (+/-) runnable version of it, developed
for the previous 2.9.0 release with Py 2.6.

No luck at the first run. The application did not crash,
but Python quits smoothly with an exit code error != 0,
(>Exit code: -1073740777)

I quickly narrowed the error and I found, the guilty line
was:

self.MarkerDefine(self.MarkerPs1, wx.stc.STC_MARK_ARROWS, '#8000ff',
'')
where self == wx.stc.StyledTextCtrl

Removing the 4th arg solved the problem.

After tyoing a little bit:

MarkerDefine(self, int markerNumber, int markerSymbol, \
    Colour foreground=wxNullColour, Colour background=wxNullColour)

It seems there is some missmatch with the both Colour arguments.
Empty strings are no longer supported, assuming such a behaviour
was correct in verions < 2.9.1.pre !?

jmf

Hi,

I downloaded the runtime version for Py 2.7 and installed it
on Windows 7, 32 bits, without problem.

The next step was a test with my interactive Python interpreter,
psi. I already have a (+/-) runnable version of it, developed
for the previous 2.9.0 release with Py 2.6.

No luck at the first run. The application did not crash,
but Python quits smoothly with an exit code error != 0,
(>Exit code: -1073740777)

I quickly narrowed the error and I found, the guilty line
was:

self.MarkerDefine(self.MarkerPs1, wx.stc.STC_MARK_ARROWS, '#8000ff',
'')
where self == wx.stc.StyledTextCtrl

Removing the 4th arg solved the problem.

After tyoing a little bit:

MarkerDefine(self, int markerNumber, int markerSymbol, \
     Colour foreground=wxNullColour, Colour background=wxNullColour)

It seems there is some missmatch with the both Colour arguments.
Empty strings are no longer supported, assuming such a behaviour
was correct in verions< 2.9.1.pre !?

The typemap used there should be doing essentially the same thing that wx.NamedColour does with the string, which results in an invalid colour object being created:

  >>> c = wx.NamedColour('')
  >>> c.Ok()
  False

MarkerDefine does check if the colour object is Ok() before passing it on to other APIs, so I expect that it should be working. Things like frame.SetBackgroundColour('') also work without an abnormal exit.

If you can make a small sample that shows the problem then I can trace through it in the debugger and see better what is happening.

···

On 9/28/10 10:51 AM, jmfauth wrote:

--
Robin Dunn
Software Craftsman

Just downloaded and installed it.

I like the "DVC" stuff, are the ListCtrl and TreeListCtrl the basic

controls, or are they using new ones?

**UltimateListCtrl** - I get lots of this:
Traceback (most recent call last):
  File

“C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\lib\agw\ultimatelistctrl.py”,
line 11973, in OnInternalIdle
if self._mainWin._dirty:
AttributeError: ‘NoneType’ object has no attribute ‘_dirty’

**AUI_Notebook:**
- tabs are not created
···

http://wxpython.wxcommunity.com/preview/20100922/
http://wxpython.wxcommunity.com/preview/20100922/CHANGES.html

http://trac.wxwidgets.org

Hi Werner,

Just downloaded and installed it.

I like the "DVC" stuff, are the ListCtrl and TreeListCtrl the basic
controls, or are they using new ones?

UltimateListCtrl - I get lots of this:
Traceback (most recent call last):
File
"C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\lib\agw\ultimatelistctrl.py",
line 11973, in OnInternalIdle
if self._mainWin._dirty:
AttributeError: 'NoneType' object has no attribute '_dirty'

AUI_Notebook:
- tabs are not created

It would be nice if I could test them on my PC and fix the issues, but
I have only got Windows 7 now and any demo which requires a SetIcon on
the demo frame will not even start on my PC (I get an AssertionError
as I stated previously). I'd prefer not to comment-out *all* the demos
SetIcon() calls before being able to test what's wrong with the AGW
components...

HyperTreeList:
C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\lib\agw\customtreectrl.py:2522:
DeprecationWarning: DrawRadioButton is depracated, use `DrawRadioBitmap`
instead.

"deprEcated"... amazing how many English-speaking people are able to
misspell that word... That should be easy to fix but it will require
*another* version-dependent if-else check inside CustomTreeCtrl. Not
sure where the advantage of using DrawRadioBitmap instead of
DrawRadioButton is...

render.DrawRadioButton(self, mdc, (0, 0, x, y), flag)
Traceback (most recent call last):
File "agw\HyperTreeList.py", line 2516, in OnButton
self.win = HyperTreeListDemo(self, self.log)
File "agw\HyperTreeList.py", line 1061, in __init__
self.PopulateLeftPanel(self.tree.styles, self.tree.events)
File "agw\HyperTreeList.py", line 1196, in PopulateLeftPanel
flexgridcolumn.Add(columnimages, 0, wx.ALIGN_CENTER_VERTICAL)
File "C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 14034,
in
Add
return _core_.Sizer_Add(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\co
mmon\sizer.cpp(1369) in wxGridSizer::DoInsert(): too many items (11 > 2*5)
in gr
id sizer (maybe you should omit the number of either rows or columns?)

LabelBook:
Traceback (most recent call last):
File "agw\LabelBook.py", line 539, in OnButton
self.win = LabelBookDemo(self, self.log)
File "agw\LabelBook.py", line 98, in __init__
self.DoLayout()
File "agw\LabelBook.py", line 204, in DoLayout
gridsizer.Add(label6, 0,
wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT
, 3)
File "C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 14034,
in
Add
return _core_.Sizer_Add(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\co
mmon\sizer.cpp(1369) in wxGridSizer::DoInsert(): too many items (13 > 2*6)
in gr
id sizer (maybe you should omit the number of either rows or columns?)

Does this mean that I can instantiate *all* the GridSizers (and
derived sizers) with no columns and rows and they will work flawlessly
even in older versions of wxPython? These errors are only
demos-related, so they will be easy to fix as long as the fix I
mentioned above is backward compatible.

SuperToolTip:
Size frame bigger so buttons at the bottom are shown without having to
resize manually

Uhm, I guess I don't understand this one.

MediaCtrl:
Hard crash of Python the first time I used, but can not recreate the crash.
Maybe some conflict with another demo I run before (I am going just
"walking" down the list of the demos).

I got the same behaviour on Windows 7.

ColourDB:
Is drawing over the top of what is already shown in the demo tab. E.G. use
DragXXXList and then go to ColourDB

Yes, I see this one too, you can actually see-through the previous
selected demo. Looks like some kind of transparency issue.

A couple other remarks:
- the demo tries to install to "Program Files" on Windows (I am on 7 64
bit), would be much nicer if it would install into e.g. Pythonxx\Doc
- it would also be nice when installing the demo that the installer asks
which Python version to use. I have 2.5 and 2.6 but 2.5 is default for
.py/.pyw but new stuff I try with 2.6, and it took me a moment to figure out
why the demo loaded with wxPython 2.8 and not 2.9.

+1 for me. The demo should go somewhere else other than Program Files
on Windows.

Robin, it would be nice to have a very quick and dirty new pre-release
that fixes the icon issues on the frames so that I can try and fix AGW
for 2.9. I understand it's a burden to put up another pre-release,
though...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 30 September 2010 12:31, werner wrote:

What about something like

import wx

def crashingIconHook(self, name):
     if name in ('SetIcon', 'Icon'):
         return None
     super(wx._core.Window, self).__getattribute__( name )

wx._core.Window.__getattribute__ = crashingIconHook

to quickly fix your icon crashes?

-Matthias

···

Am 30.09.2010, 12:21 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

Hi Werner,

On 30 September 2010 12:31, werner wrote:

Just downloaded and installed it.

I like the "DVC" stuff, are the ListCtrl and TreeListCtrl the basic
controls, or are they using new ones?

UltimateListCtrl - I get lots of this:
Traceback (most recent call last):
  File
"C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\lib\agw\ultimatelistctrl.py",
line 11973, in OnInternalIdle
    if self._mainWin._dirty:
AttributeError: 'NoneType' object has no attribute '_dirty'

AUI_Notebook:
- tabs are not created

It would be nice if I could test them on my PC and fix the issues, but
I have only got Windows 7 now and any demo which requires a SetIcon on
the demo frame will not even start on my PC (I get an AssertionError
as I stated previously). I'd prefer not to comment-out *all* the demos
SetIcon() calls before being able to test what's wrong with the AGW
components...

HyperTreeList:
C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\lib\agw\customtreectrl.py:2522:
DeprecationWarning: DrawRadioButton is depracated, use `DrawRadioBitmap`
instead.

"deprEcated"... amazing how many English-speaking people are able to
misspell that word... That should be easy to fix but it will require
*another* version-dependent if-else check inside CustomTreeCtrl. Not
sure where the advantage of using DrawRadioBitmap instead of
DrawRadioButton is...

  render.DrawRadioButton(self, mdc, (0, 0, x, y), flag)
Traceback (most recent call last):
  File "agw\HyperTreeList.py", line 2516, in OnButton
    self.win = HyperTreeListDemo(self, self.log)
  File "agw\HyperTreeList.py", line 1061, in __init__
    self.PopulateLeftPanel(self.tree.styles, self.tree.events)
  File "agw\HyperTreeList.py", line 1196, in PopulateLeftPanel
    flexgridcolumn.Add(columnimages, 0, wx.ALIGN_CENTER_VERTICAL)
  File "C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 14034,
in
Add
    return _core_.Sizer_Add(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\co
mmon\sizer.cpp(1369) in wxGridSizer::DoInsert(): too many items (11 > 2*5)
in gr
id sizer (maybe you should omit the number of either rows or columns?)

LabelBook:
Traceback (most recent call last):
  File "agw\LabelBook.py", line 539, in OnButton
    self.win = LabelBookDemo(self, self.log)
  File "agw\LabelBook.py", line 98, in __init__
    self.DoLayout()
  File "agw\LabelBook.py", line 204, in DoLayout
    gridsizer.Add(label6, 0,
wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT
, 3)
  File "C:\Python26\lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 14034,
in
Add
    return _core_.Sizer_Add(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\co
mmon\sizer.cpp(1369) in wxGridSizer::DoInsert(): too many items (13 > 2*6)
in gr
id sizer (maybe you should omit the number of either rows or columns?)

Does this mean that I can instantiate *all* the GridSizers (and
derived sizers) with no columns and rows and they will work flawlessly
even in older versions of wxPython? These errors are only
demos-related, so they will be easy to fix as long as the fix I
mentioned above is backward compatible.

SuperToolTip:
Size frame bigger so buttons at the bottom are shown without having to
resize manually

Uhm, I guess I don't understand this one.

MediaCtrl:
Hard crash of Python the first time I used, but can not recreate the crash.
Maybe some conflict with another demo I run before (I am going just
"walking" down the list of the demos).

I got the same behaviour on Windows 7.

ColourDB:
Is drawing over the top of what is already shown in the demo tab. E.G. use
DragXXXList and then go to ColourDB

Yes, I see this one too, you can actually see-through the previous
selected demo. Looks like some kind of transparency issue.

A couple other remarks:
- the demo tries to install to "Program Files" on Windows (I am on 7 64
bit), would be much nicer if it would install into e.g. Pythonxx\Doc
- it would also be nice when installing the demo that the installer asks
which Python version to use. I have 2.5 and 2.6 but 2.5 is default for
.py/.pyw but new stuff I try with 2.6, and it took me a moment to figure out
why the demo loaded with wxPython 2.8 and not 2.9.

+1 for me. The demo should go somewhere else other than Program Files
on Windows.

Robin, it would be nice to have a very quick and dirty new pre-release
that fixes the icon issues on the frames so that I can try and fix AGW
for 2.9. I understand it's a burden to put up another pre-release,
though...

Testing my own application I run into this:

ObjectListView does this:

font = self.GetFont()
self.groupFont = wx.FFont(font.GetPointSize(), font.GetFamily(), wx.FONTFLAG_BOLD, font.GetFaceName())

And I get this traceback:
wx._core.PyAssertionError: C++ assertion "Assert failure" failed at ..\..\src\msw\font.cpp(668) in wxNativeFontInfo::SetFamily(): invalid font family
File "c:\dev\TwcbBranchesV32\Program\twcb.py", line 1420, in <module>
   main()
File "c:\dev\TwcbBranchesV32\Program\twcb.py", line 1417, in main
   appl.MainLoop()
File "C:\Python26\Lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 8499, in MainLoop
   wx.PyApp.MainLoop(self)
File "C:\Python26\Lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 7782, in MainLoop
   return _core_.PyApp_MainLoop(*args, **kwargs)
File "C:\Python26\Lib\site-packages\wx-2.9.1-msw\wx\lib\buttons.py", line 342, in OnLeftUp
   self.Notify()
File "C:\Python26\Lib\site-packages\wx-2.9.1-msw\wx\lib\buttons.py", line 223, in Notify
   self.GetEventHandler().ProcessEvent(evt)
File "C:\Python26\Lib\site-packages\wx-2.9.1-msw\wx\_core.py", line 4050, in ProcessEvent
   return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
File "c:\dev\TwcbBranchesV32\Program\twcbF.py", line 2216, in OnStartWineButton
   self.DoStartWine()
File "c:\dev\TwcbBranchesV32\Program\twcbF.py", line 2227, in DoStartWine
   style=wx.TAB_TRAVERSAL)
File "c:\dev\TwcbBranchesV32\Program\appwine.py", line 104, in __init__
   -1), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
File "c:\dev\TwcbBranchesV32\Program\olv.py", line 32, in __init__
   self.Init()
File "c:\dev\TwcbBranchesV32\Program\olv.py", line 53, in Init
   self.InitWidgets()
File "c:\dev\TwcbBranchesV32\Program\olv.py", line 65, in InitWidgets
   self.myOlv = olvLib.GroupListView(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL)
File "C:\Python26\Lib\site-packages\ObjectListView\ObjectListView.py", line 2606, in __init__
   self.groupFont = wx.FFont(font.GetPointSize(), font.GetFamily(), wx.FONTFLAG_BOLD, font.GetFaceName())
File "C:\Python26\Lib\site-packages\wx-2.9.1-msw\wx\_gdi.py", line 2606, in FFont
   val = _gdi_.new_FFont(*args, **kwargs)

font.GetFamily() returns 77

If I run my application using wxPython 2.8.11 unicode I get '74'.

Any idea of where I should look for why I get a different value within OLV when changing to wxPython 2.9.

Werner

SuperToolTip:
Size frame bigger so buttons at the bottom are shown without having to
resize manually
Uhm, I guess I don't understand this one.

I.e. maximize it or size so that the two buttons at the bottom are

shown without having to scroll.

Werner
···

http://xoomer.alice.it/infinity77/http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html

Hi Matthias,

What about something like

import wx

def crashingIconHook(self, name):
if name in ('SetIcon', 'Icon'):
return None
super(wx._core.Window, self).__getattribute__( name )

wx._core.Window.__getattribute__ = crashingIconHook

to quickly fix your icon crashes?

Nice idea, but for some reason I get this now:

E:\AGW\demos>AUI.py
wx.version: 2.9.1.1.b20100922 (msw-unicode)
pid: 4012
Traceback (most recent call last):
  File "E:\AGW\demos\AUI.py", line 3015, in <module>
    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
  File "E:\AGW\demos\run.py", line 155, in main
    app = RunDemoApp(name, module, useShell)
  File "E:\AGW\demos\run.py", line 49, in __init__
    wx.App.__init__(self, redirect=False)
  File "C:\Python25\Lib\site-packages\wx-2.9.1-msw\wx\_core.py", line
8470, in __init__
    self._BootstrapApp()
  File "C:\Python25\Lib\site-packages\wx-2.9.1-msw\wx\_core.py", line
8035, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "E:\AGW\demos\run.py", line 59, in OnInit
    style=wx.DEFAULT_FRAME_STYLE, name="run a sample")
  File "C:\Python25\Lib\site-packages\wx-2.9.1-msw\wx\_windows.py",
line 576, in __init__
    self._setOORInfo(self)
TypeError: 'NoneType' object is not callable
swig/python detected a memory leak of type 'wxFrame *', no destructor found.

:frowning:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 30 September 2010 13:31, Matthias wrote:

Hmm what about

import wx

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
     if name in ('SetIcon', 'Icon'):
       return None
     return orgFunc( name )

wx._core.Window.__getattribute__ = crashingIconHook

-Matthias

···

Am 30.09.2010, 14:36 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

Almost. With some modifications, and precisely like this:

import wx

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
   if name in ('SetIcon', 'Icon'):
     return None
   return org_func(self, name)

wx._core.Window.__getattribute__ = crashingIconHook

I get now:

E:\AGW\demos>AUI.py
wx.version: 2.9.1.1.b20100922 (msw-unicode)
pid: 3100
Traceback (most recent call last):
  File "E:\AGW\demos\AUI.py", line 2993, in OnButton1
    self.win = MainAUI(self, self.log)
  File "E:\AGW\demos\AUI.py", line 2964, in MainAUI
    frame = AuiFrame(parent, -1, "AUI Test Frame", size=(800, 600), log=log)
  File "E:\AGW\demos\AUI.py", line 873, in __init__
    self.SetIcon(images.Mondrian.GetIcon())
TypeError: 'NoneType' object is not callable

However, I have tried to comment-out the calls to SetIcon in most
demos but I am getting other AssertionErrors related to the font bug I
was mentioning earlier in this thread, which again will have to be
taken care of *before* actually looking for a bug in AGW.

BTW, Werner, could you demonstrate the AuiNotebook bug in the demo? On
my machine the tabs are created just fine.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 30 September 2010 15:52, Matthias wrote:

Am 30.09.2010, 14:36 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

Hmm what about

import wx

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
if name in ('SetIcon', 'Icon'):
return None
return orgFunc( name )

wx._core.Window.__getattribute__ = crashingIconHook

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
    if name in ('SetIcon', 'Icon'):
      return lambda *args, **keys: None
    return org_func(self, name)

wx._core.Window.__getattribute__ = crashingIconHook

Above is my last try :slight_smile: I can't test the code I am sending atm...

-Matthias

···

Am 30.09.2010, 15:01 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

mmon\sizer.cpp(1369) in wxGridSizer::DoInsert(): too many items (13> 2*6)
in gr
id sizer (maybe you should omit the number of either rows or columns?)

Does this mean that I can instantiate *all* the GridSizers (and
derived sizers) with no columns and rows and they will work flawlessly
even in older versions of wxPython?

No, it's saying that you should specify just one or the other, or ensure that the number of items is rows*cols. I usually change them to just specify cols, and use keyword args so it is explicit.

Robin, it would be nice to have a very quick and dirty new pre-release
that fixes the icon issues on the frames so that I can try and fix AGW
for 2.9.

Yep, I'm planning on it.

···

On 9/30/10 3:21 AM, Andrea Gavana wrote:

--
Robin Dunn
Software Craftsman

This bug in wx.Font has been fixed. 77 is wx.FONTFAMILY_UNKNOWN, the change was to instead have it return wx.FONTFAMILY_DEFAULT when it can't figure out the family.

···

On 9/30/10 4:08 AM, werner wrote:

font.GetFamily() returns 77

If I run my application using wxPython 2.8.11 unicode I get '74'.

Any idea of where I should look for why I get a different value within
OLV when changing to wxPython 2.9.

--
Robin Dunn
Software Craftsman

If you're only using SetIcon and not the Icon property then this will work:

wx.Frame.SetIcon = lambda self,font: None

···

On 9/30/10 6:06 AM, Matthias wrote:

Am 30.09.2010, 15:01 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
if name in ('SetIcon', 'Icon'):
return lambda *args, **keys: None
return org_func(self, name)

wx._core.Window.__getattribute__ = crashingIconHook

Above is my last try :slight_smile: I can't test the code I am sending atm...

--
Robin Dunn
Software Craftsman

Yeah, I didn't know if there are subclasses overriding SetIcon somewhere in wxPython, so I chose the more complex solution.

-Matthias

···

Am 30.09.2010, 19:01 Uhr, schrieb Robin Dunn <robin@alldunn.com>:

On 9/30/10 6:06 AM, Matthias wrote:

Am 30.09.2010, 15:01 Uhr, schrieb Andrea Gavana >> <andrea.gavana@gmail.com>:

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
if name in ('SetIcon', 'Icon'):
return lambda *args, **keys: None
return org_func(self, name)

wx._core.Window.__getattribute__ = crashingIconHook

Above is my last try :slight_smile: I can't test the code I am sending atm...

If you're only using SetIcon and not the Icon property then this will work:

wx.Frame.SetIcon = lambda self,font: None

Er... Not that it matters since the arg is not used but I meant to type "icon" instead of "font" there. I guess my mind was still working on the font issue while I was typing that. :-/

···

On 9/30/10 10:01 AM, Robin Dunn wrote:

On 9/30/10 6:06 AM, Matthias wrote:

Am 30.09.2010, 15:01 Uhr, schrieb Andrea Gavana >> <andrea.gavana@gmail.com>:

org_func = wx._core.Window.__getattribute__

def crashingIconHook(self, name):
if name in ('SetIcon', 'Icon'):
return lambda *args, **keys: None
return org_func(self, name)

wx._core.Window.__getattribute__ = crashingIconHook

Above is my last try :slight_smile: I can't test the code I am sending atm...

If you're only using SetIcon and not the Icon property then this will work:

wx.Frame.SetIcon = lambda self,font: None

--
Robin Dunn
Software Craftsman