Re: WxImageButton on Linux

Robin Dunn <[email protected]> Fri, 19 Apr 2019 11:25:43 -0700 (PDT)
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
------=_Part_322_1689223646.1555698343386
Content-Type: multipart/alternative; 
	boundary="----=_Part_323_596957579.1555698343386"

------=_Part_323_596957579.1555698343386
Content-Type: text/plain; charset="UTF-8"

On Friday, April 19, 2019 at 5:53:12 AM UTC-7, philippe DALET wrote:
>
> Hello,
>
> I started to upgrade Pythoncard for python3.
> All components work on linux (64 bits, Ubuntu 180.4 and 16.04, gtk2 or 
> gtk3, python 3.5 and 3.6 and 3.7)  except wxImageButton .
> It works properly on windows seven.
>
>
> Message:
>
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/dist-packages/PythonCard/model.py", line 
> 372, in OnInit
>     self._initBackgrounds(self.resource)
>   File "/usr/local/lib/python3.6/dist-packages/PythonCard/model.py", line 
> 365, in _initBackgrounds
>     bg = self.frameClass(None, bgRsrc)
>   File "/usr/local/lib/python3.6/dist-packages/PythonCard/model.py", line 
> 548, in __init__
>     self._initLayout(aBgRsrc.components)
>   File "/usr/local/lib/python3.6/dist-packages/PythonCard/model.py", line 
> 801, in _initLayout
>     self.components[rsrc.name] = rsrc
>   File "/usr/local/lib/python3.6/dist-packages/PythonCard/model.py", line 
> 73, in __setitem__
>     control = component.ComponentFactory().createComponent(self.parent, 
> self.parent.panel, item)
>   File "/usr/local/lib/python3.6/dist-packages/PythonCard/component.py", 
> line 340, in createComponent
>     component = clazz(aParent, aResource)
>   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:
>   overload 1: argument 3 has unexpected type 'Bitmap'
>   overload 2: too many arguments
> OnInit returned false, exiting...
> Segmentation fault (core dumped)
> Pause ... 
>
>
> The third parameters is not good: 'Bitmap'.
>


Are you sure that self._bitmap.getBits() is returning a wx.Bitmap and not 
some other Bitmap class? (Such as PC's graphic.Bitmap.)

--
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_323_596957579.1555698343386
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, April 19, 2019 at 5:53:12 AM UTC-7, philippe DA=
LET wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Hel=
lo,<div><br></div><div>I started to upgrade Pythoncard for python3.</div><d=
iv>All components work on linux (64 bits, Ubuntu 180.4 and 16.04, gtk2 or g=
tk3, python 3.5 and 3.6 and 3.7)=C2=A0 except wxImageButton=C2=A0.</div><di=
v>It works properly on windows seven.</div><div><br></div><div><br></div><d=
iv>Message:</div><div><br></div><div><div>Traceback (most recent call last)=
:</div><div>=C2=A0 File &quot;/usr/local/lib/python3.6/<wbr>dist-packages/P=
ythonCard/<wbr>model.py&quot;, line 372, in OnInit</div><div>=C2=A0 =C2=A0 =
self._initBackgrounds(self.<wbr>resource)</div><div>=C2=A0 File &quot;/usr/=
local/lib/python3.6/<wbr>dist-packages/PythonCard/<wbr>model.py&quot;, line=
 365, in _initBackgrounds</div><div>=C2=A0 =C2=A0 bg =3D self.frameClass(No=
ne, bgRsrc)</div><div>=C2=A0 File &quot;/usr/local/lib/python3.6/<wbr>dist-=
packages/PythonCard/<wbr>model.py&quot;, line 548, in __init__</div><div>=
=C2=A0 =C2=A0 self._initLayout(aBgRsrc.<wbr>components)</div><div>=C2=A0 Fi=
le &quot;/usr/local/lib/python3.6/<wbr>dist-packages/PythonCard/<wbr>model.=
py&quot;, line 801, in _initLayout</div><div>=C2=A0 =C2=A0 self.components[=
<a href=3D"http://rsrc.name" target=3D"_blank" rel=3D"nofollow" onmousedown=
=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frsrc.name\=
x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_bYpoOs4YeMPJkIuBFl4XeztU8A&#39;;r=
eturn true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhtt=
p%3A%2F%2Frsrc.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_bYpoOs4YeMPJk=
IuBFl4XeztU8A&#39;;return true;">rsrc.name</a>] =3D rsrc</div><div>=C2=A0 F=
ile &quot;/usr/local/lib/python3.6/<wbr>dist-packages/PythonCard/<wbr>model=
.py&quot;, line 73, in __setitem__</div><div>=C2=A0 =C2=A0 control =3D comp=
onent.ComponentFactory().<wbr>createComponent(self.parent, self.parent.pane=
l, item)</div><div>=C2=A0 File &quot;/usr/local/lib/python3.6/<wbr>dist-pac=
kages/PythonCard/<wbr>component.py&quot;, line 340, in createComponent</div=
><div>=C2=A0 =C2=A0 component =3D clazz(aParent, aResource)</div><div>=C2=
=A0 File &quot;/usr/local/lib/python3.6/<wbr>dist-packages/PythonCard/<wbr>=
components/imagebutton.py&quot;, line 56, in __init__</div><div>=C2=A0 =C2=
=A0 wx.BitmapButton.__init__(self, parent, id, self._bitmap.getBits(),pos, =
size, style, validator, name)</div><div>TypeError: Control(): arguments did=
 not match any overloaded call:</div><div>=C2=A0 overload 1: argument 3 has=
 unexpected type &#39;Bitmap&#39;</div><div>=C2=A0 overload 2: too many arg=
uments</div><div>OnInit returned false, exiting...</div><div>Segmentation f=
ault (core dumped)</div><div>Pause ...=C2=A0</div></div><div><br></div><div=
><br></div><div>The third parameters is not good: &#39;Bitmap&#39;.</div></=
div></blockquote><div><br></div><div><br></div><div>Are you sure that self.=
_bitmap.getBits() is returning a wx.Bitmap and not some other Bitmap class?=
 (Such as PC&#39;s graphic.Bitmap.)</div><div><br></div><div>--</div><div>R=
obin</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_323_596957579.1555698343386--

------=_Part_322_1689223646.1555698343386--