Re: [wxPython-dev] wx.RadioBox crash
Hello,
app=wx.App(0)
w=wx.Frame(None)
e=wx.RadioBox(w)
==>crash
I don’t think this is supposed to work. You haven’t done basic app
initialization and yet you’re trying to create windows and controls.
Follow the tutorials on the web and on wxpython.org for basic info on
how to get a “Hello World” app going.
It’s not about app initialization. I
A run in debug mode shows that the problem is a “division by zero”
in wxRadioBox::GetNumVer(), because there are no choices in the RadioBox.
OK, a RadioBox without items is useless, but
I think that the C++ code should be corrected anyway.
wxRadioBox::GetNumHor() has the same problem, btw.
···
–
Amaury Forgeot d’Arc
Ubix Development
www.ubitrade.com
Hello,
thanks for clarifying.
This is what I meant; It should not happen to crash, even
when there are silly parameters.
Did you see that on MSW?
If so, can you describe it shortly, how to run wxPython
in debug mode then please ?
···
On Thu, 15 Sep 2005 09:08:33 +0200, "Amaury Forgeot D Arc" <Amaury.Forgeotdarc@Ubitrade.Com> wrote:
Hello,
> app=wx.App(0)
> w=wx.Frame(None)
> e=wx.RadioBox(w)
> ==>crash
I don't think this is supposed to work. You haven't done basic app
initialization and yet you're trying to create windows and controls.
Follow the tutorials on the web and on wxpython.org for basic info on
how to get a "Hello World" app going.
It's not about app initialization. I
A run in debug mode shows that the problem is a "division by zero"
in wxRadioBox::GetNumVer(), because there are no choices in the RadioBox.
OK, a RadioBox without items is useless, but
I think that the C++ code should be corrected anyway.
wxRadioBox::GetNumHor() has the same problem, btw.
--
Franz Steinhaeusler
Hello,
> > app=wx.App(0)
> > w=wx.Frame(None)
> > e=wx.RadioBox(w)
> > ==>crash
>
> I don't think this is supposed to work. You haven't done basic app
> initialization and yet you're trying to create windows and
controls.
> Follow the tutorials on the web and on wxpython.org for basic info
on
> how to get a "Hello World" app going.
It's not about app initialization. I
A run in debug mode shows that the problem is a "division by zero"
in wxRadioBox::GetNumVer(), because there are no choices in the
RadioBox.
The gtk port has this issue too. It's a division by zero but in
wxRadioBox::Create, if I remember.
OK, a RadioBox without items is useless, but
I think that the C++ code should be corrected anyway.
wxRadioBox::GetNumHor() has the same problem, btw.
I agree.
Ricardo
···
On Thu, 2005-09-15 at 09:08 +0200, Amaury Forgeot D Arc wrote:
Hello,
Regarding:
>>I think that the C++ code should be corrected anyway.
>>
I agree.
The code in wxRadioBoxBase::GetNextItem (src/common/radiocmn.cpp) also needs some divide by zero protection.
adding the following at line 59 should fix it:
if ((numCols <= 0) || (numRows <= 0))
return 0;
The GTK code has a number of places where similar checks should be inserted.
Regards,
David S.
···
===========
Franz Steinhäusler wrote:
On Thu, 15 Sep 2005 09:08:33 +0200, "Amaury Forgeot D Arc" <Amaury.Forgeotdarc@Ubitrade.Com> wrote:
Hello,
app=wx.App(0)
w=wx.Frame(None)
e=wx.RadioBox(w)
==>crash
I don't think this is supposed to work. You haven't done basic app
initialization and yet you're trying to create windows and controls.
Follow the tutorials on the web and on wxpython.org for basic info on
how to get a "Hello World" app going.
It's not about app initialization. I
A run in debug mode shows that the problem is a "division by zero"
in wxRadioBox::GetNumVer(), because there are no choices in the RadioBox.
OK, a RadioBox without items is useless, but
I think that the C++ code should be corrected anyway.
wxRadioBox::GetNumHor() has the same problem, btw.
Hello,
thanks for clarifying.
This is what I meant; It should not happen to crash, even
when there are silly parameters.
Did you see that on MSW?
If so, can you describe it shortly, how to run wxPython in debug mode then please ?
--
Franz Steinhaeusler
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-dev-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help@lists.wxwidgets.org