Re: Re: WxImageButton on Linux

Robin Dunn <[email protected]> Fri, 19 Apr 2019 17:14:16 -0700 (PDT)
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
------=_Part_48_1080893391.1555719256702
Content-Type: multipart/alternative; 
	boundary="----=_Part_49_629801939.1555719256702"

------=_Part_49_629801939.1555719256702
Content-Type: text/plain; charset="UTF-8"

On Friday, April 19, 2019 at 5:06:32 PM UTC-7, Robin Dunn wrote:
>
> On Friday, April 19, 2019 at 12:53:40 PM UTC-7, philippe DALET wrote:
>>
>> Yes, self._bitmap.getBits() is returning a wx.Bitmap.
>> It runs properly on windows. It seems that it expects another parameter. 
>>
>> Is it possible to debug with python, then in C with an IDE on linux ?
>>
>
>
> The C++ wrapper code where that exception is raised is identical on each 
> platform and it hasn't yet gotten to any platform-dependent wxWidgets code, 
> it's just type-checking the parameters to  decide which wxBitmapButton 
> constructor to call. So if it works on one platform and not another then it 
> must be differences in the inputs from the Python side of things.
>
> Ah, I just noticed something odd:
>
> >  File 
> "/usr/local/lib/python3.6/dist-packages/PythonCard/components/imagebutton.py", 
> line 56, in __init__
> >     wx.BitmapButton.__init__(self, parent, id, 
> self._bitmap.getBits(),pos, size, style, validator, name)
> > TypeError: *Control():* arguments did not match any overloaded call:
>
> Somehow it is not trying to call wx.BitmapButton.__init__ but wx.Control's 
> __init__. Does PythonCard do any monkey-patching or something that could be 
> replacing wx.BitmapButton with wx.Control?
>


For example, I can duplicate the exception with code like this:

wx.BitmapButton = wx.Control
class TestButton(wx.BitmapButton):
    def __init__(self, parent, id, bmp, pos=wx.DefaultPosition, 
size=wx.DefaultSize, style=0:
        wx.BitmapButton.__init__(self, parent, id, bmp, pos, size, style)

 
--
Robin

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

------=_Part_49_629801939.1555719256702
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, April 19, 2019 at 5:06:32 PM UTC-7, Robin Dunn =
wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">On Frid=
ay, April 19, 2019 at 12:53:40 PM UTC-7, philippe DALET wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr">Yes, self._bitmap.getBits() is =
returning a wx.Bitmap.<div>It runs properly on windows. It seems that it ex=
pects another parameter.=C2=A0</div><div><br></div><div>Is it possible to d=
ebug with python, then in C with an IDE on linux ?</div></div></blockquote>=
<div><br></div><div><br></div><div>The C++ wrapper code where that exceptio=
n is raised is identical on each platform and it hasn&#39;t yet gotten to a=
ny platform-dependent wxWidgets code, it&#39;s just type-checking the param=
eters to=C2=A0 decide which wxBitmapButton constructor to call. So if it wo=
rks on one platform and not another then it must be differences in the inpu=
ts from the Python side of things.</div><div><br></div><div>Ah, I just noti=
ced something odd:</div><div><br></div><div><div>&gt;=C2=A0 File &quot;/usr=
/local/lib/python3.6/<wbr>dist-packages/PythonCard/<wbr>components/imagebut=
ton.py&quot;, line 56, in __init__</div><div>&gt;=C2=A0 =C2=A0 =C2=A0wx.Bit=
mapButton.__init__(<wbr>self, parent, id, self._bitmap.getBits(),pos, size,=
 style, validator, name)</div><div>&gt; TypeError: <b><font color=3D"#ff000=
0">Control():</font></b> arguments did not match any overloaded call:</div>=
</div><div><br></div><div>Somehow it is not trying to call wx.BitmapButton.=
__init__ but wx.Control&#39;s __init__. Does PythonCard do any monkey-patch=
ing or something that could be replacing wx.BitmapButton with wx.Control?</=
div></div></blockquote><div><br></div><div><br></div><div>For example, I ca=
n duplicate the exception with code like this:</div><div><br></div><div><di=
v><font face=3D"courier new, monospace">wx.BitmapButton =3D wx.Control</fon=
t></div><div><font face=3D"courier new, monospace">class TestButton(wx.Bitm=
apButton):</font></div><div><font face=3D"courier new, monospace">=C2=A0 =
=C2=A0 def __init__(self, parent, id, bmp, pos=3Dwx.DefaultPosition, size=
=3Dwx.DefaultSize, style=3D0:</font></div><div><span style=3D"font-family: =
&quot;courier new&quot;, monospace;">=C2=A0 =C2=A0 =C2=A0 =C2=A0 wx.BitmapB=
utton.__init__(self, parent, id, bmp, pos, size, style)</span><br></div></d=
iv><div><font face=3D"courier new, monospace"><br></font></div><div>=C2=A0<=
/div><div>--</div><div>Robin</div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-dev&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wxPyth=
[email protected]</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

------=_Part_49_629801939.1555719256702--

------=_Part_48_1080893391.1555719256702--