EXC_BAD_ACCESS calling wx.TextCtrl.SetValue in 2.9 carbon

97 views
Skip to first unread message

Paul

unread,
Mar 22, 2012, 6:19:33 AM3/22/12
to wxPython-users
Hey,

I've got a program which worked fine on 2.8 however after changing to
2.9 I got Python quit unexpectedly errors when running. I've stepped
through the code and found its a .SetValue call on a TextCtrl which is
causing the program to crash. Is this known about? Is there a change
in 2.9 or a work around for this? Any ideas what I can do to get this
working in 2.9?

Cheers!

Paul

Paul

unread,
Mar 22, 2012, 6:59:03 AM3/22/12
to wxPython-users
I noticed creating a wx.lib.masked.TimeCtrl causes the same error, in
TextBase ChangeValue on the line:
_core_.TextEntryBase_ChangeValue(*args, **kwargs)

I've also noticed that I can't see the selection in combo boxes (they
always look blank)

When I call GetValue on a ComboBox I get:
wx._core.PyAssertionError: C++ assertion "IsValid(n)" failed at /BUILD/
wxPython-src-2.9.3.1/src/osx/choice_osx.cpp(212) in GetString():
wxChoice::GetString(): invalid index

There's other problems as well, mainly visual with custom drawn items
and layouts that I guess are just differences in 2.9

Basically my motivation for switching to 2.9 is the frame native
toolbar in mac is drag-able by the whole toolbar and not just the
title bar like in 2.8 but it looks like I would have to overcome all
these issues if I were to do so. Is there a way instead I could
perhaps take the toolbar part of 2.9 and include it, or overwrite it
in 2.8 somehow?

What's my best option?

Robin Dunn

unread,
Mar 22, 2012, 1:11:14 PM3/22/12
to wxpytho...@googlegroups.com
On 3/22/12 3:59 AM, Paul wrote:
> On Mar 22, 10:19 am, Paul<poal...@gmail.com> wrote:
>> Hey,
>>
>> I've got a program which worked fine on 2.8 however after changing to
>> 2.9 I got Python quit unexpectedly errors when running. I've stepped
>> through the code and found its a .SetValue call on a TextCtrl which is
>> causing the program to crash. Is this known about? Is there a change
>> in 2.9 or a work around for this? Any ideas what I can do to get this
>> working in 2.9?
>>
>> Cheers!
>>
>> Paul
>
> I noticed creating a wx.lib.masked.TimeCtrl causes the same error, in
> TextBase ChangeValue on the line:
> _core_.TextEntryBase_ChangeValue(*args, **kwargs)
>
> I've also noticed that I can't see the selection in combo boxes (they
> always look blank)
>
> When I call GetValue on a ComboBox I get:
> wx._core.PyAssertionError: C++ assertion "IsValid(n)" failed at /BUILD/
> wxPython-src-2.9.3.1/src/osx/choice_osx.cpp(212) in GetString():
> wxChoice::GetString(): invalid index

Please make small runnable samples for that demonstrates each of these
problems. http://wiki.wxpython.org/MakingSampleApps Also, what version
of OSX are you using? Carbon or Cocoa build of wxPython? Running Python
in 32-bit or 64-bit mode?


>
> There's other problems as well, mainly visual with custom drawn items
> and layouts that I guess are just differences in 2.9
>
> Basically my motivation for switching to 2.9 is the frame native
> toolbar in mac is drag-able by the whole toolbar and not just the
> title bar like in 2.8 but it looks like I would have to overcome all
> these issues if I were to do so. Is there a way instead I could
> perhaps take the toolbar part of 2.9 and include it, or overwrite it
> in 2.8 somehow?

No.


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

Paul

unread,
Mar 23, 2012, 7:04:44 AM3/23/12
to wxpytho...@googlegroups.com
I've attached a small program with the problems reproduced, just change the value of i to see them all

I'm on OSX 10.6.8, on carbon build 2.9.3.1 osx-carbon (classic) with running python in 32-bit mode
 


>
> There's other problems as well, mainly visual with custom drawn items
> and layouts that I guess are just differences in 2.9
>
> Basically my motivation for switching to 2.9 is the frame native
> toolbar in mac is drag-able by the whole toolbar and not just the
> title bar like in 2.8 but it looks like I would have to overcome all
> these issues if I were to do so. Is there a way instead I could
> perhaps take the toolbar part of 2.9 and include it, or overwrite it
> in 2.8 somehow?

No.

I didn't think so :P
problems2.9.py

Paul Wiseman

unread,
Apr 10, 2012, 10:08:47 AM4/10/12
to wxpytho...@googlegroups.com
Hey Robin did you get a chance to run the sample?

Was wondering if there was any news? 

Robin Dunn

unread,
Apr 10, 2012, 6:15:25 PM4/10/12
to wxpytho...@googlegroups.com
On 4/10/12 7:08 AM, Paul Wiseman wrote:
> Hey Robin did you get a chance to run the sample?
>
> Was wondering if there was any news?

Not yet, I haven't done a another Carbon build in a while.

Paul Wiseman

unread,
Oct 5, 2012, 8:38:57 AM10/5/12
to wxpytho...@googlegroups.com
Sorry to revive this older post- and also baring in mind you did say no.

How can I get this working? I don't mind getting my hands dirty and making some cpp changes and building from source.

I was looking to see if I could find which file this might have been fixed in in 2.9, but where the toolbar is loaded in as a CDLL from the carbon framework I'm not really sure where to start looking.

Which files contain the fix for the draggable toolbar in 2.9? and roughly what changes would be needed in 2.8.12 to get it working (what wasn't working in the last version of 2.8 that disabled the dragging? I'm led to believe it used to work in earlier versions 2.8 but broke at some point?)
 

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

Robin Dunn

unread,
Oct 8, 2012, 12:55:24 PM10/8/12
to wxpytho...@googlegroups.com
On 10/5/12 5:38 AM, Paul Wiseman wrote:
> Sorry to revive this older post- and also baring in mind you did say no.
>
> How can I get this working? I don't mind getting my hands dirty and
> making some cpp changes and building from source.
>
> I was looking to see if I could find which file this might have been
> fixed in in 2.9, but where the toolbar is loaded in as a CDLL from the
> carbon framework I'm not really sure where to start looking.
>
> Which files contain the fix for the draggable toolbar in 2.9? and
> roughly what changes would be needed in 2.8.12 to get it working (what
> wasn't working in the last version of 2.8 that disabled the dragging?
> I'm led to believe it used to work in earlier versions 2.8 but broke at
> some point?)

Sorry, I don't know. You may be able to find it with some searching
through the SVN history in Trac.

http://trac.wxwidgets.org/log/wxWidgets/trunk

You may also want to try with the latest SVN version of the 2.8 branch,
if you haven't already. The fix may have been applied there since the
last release.

https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH/
https://svn.wxwidgets.org/svn/wx/wxPython/branches/WX_2_8_BRANCH/
Reply all
Reply to author
Forward
0 new messages