WxImageButton on Linux

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’.

Thanks a lot.

Philippe DALET

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

···

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’.

Robin

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 ?

Philippe.

Le ven. 19 avr. 2019 à 20:25, Robin Dunn robin@alldunn.com a écrit :

···

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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?

···

On Friday, April 19, 2019 at 12:53:40 PM UTC-7, philippe DALET wrote:

Robin

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)
···

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?

Robin

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

imagebutton.py (3.81 KB)

···

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Philippe,

Can you duplicate the problem in a small stand-alone sample?

···

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

···

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I’m not sure in what universe that 109,405 lines of Python code, plus tons of data files, that uses matplotlib and scipy is considered a “small stand-alone sample” but in this universe it isn’t.

···

Robin

On Tuesday, April 23, 2019 at 1:37:29 PM UTC-7, philippe DALET wrote:

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Yes of course.
I’ll create a simple application.

Sorry.

Philippe

Le mer. 24 avr. 2019 à 00:22, Robin Dunn robin@alldunn.com a écrit :

···

I’m not sure in what universe that 109,405 lines of Python code, plus tons of data files, that uses matplotlib and scipy is considered a “small stand-alone sample” but in this universe it isn’t.

Robin

On Tuesday, April 23, 2019 at 1:37:29 PM UTC-7, philippe DALET wrote:

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi,

A very simple Pythoncard App to run on Windows or Ubuntu.

breakpoint: PythonCard\components\Imagebutton.py line57

call wx.BitmapButton.init

wheel:

https://www.dropbox.com/s/3k6duczem056znn/PythonCard-0.9.1-py3-none-any.whl?dl=0

Thanks a lot

Philippe.

Le mer. 24 avr. 2019 à 17:14, philippe DALET philippe.dalet@gmail.com a écrit :

test.rsrc.py (459 Bytes)

test.py (313 Bytes)

imageA.png

···

Yes of course.
I’ll create a simple application.

Sorry.

Philippe

Le mer. 24 avr. 2019 à 00:22, Robin Dunn robin@alldunn.com a écrit :

I’m not sure in what universe that 109,405 lines of Python code, plus tons of data files, that uses matplotlib and scipy is considered a “small stand-alone sample” but in this universe it isn’t.

Robin

On Tuesday, April 23, 2019 at 1:37:29 PM UTC-7, philippe DALET wrote:

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

This is the problem:

class Image(widget.Widget, StaticBitmap):

...

class ImageButton(image.Image, wx.BitmapButton):

...

You have the ImageButton class deriving from two different widget classes. Not only can you not have a single widget be two different types of widget at the same time, but SIP does not support multiple inheritance of wrapped classes, which is the problem this code runs into first. (The wrong init being called when you call wx.BitmapButton.init) Even if SIP had supported it then there likely would have been errors from wxWidgets or the platform APIs.

If you change the ImageButton class to this then it will work:

class ImageButton(widget.Widget, wx.BitmapButton):

which is apparently what was intended since there is already a call to widget.Widget.init in the code.

···

Robin

On Wednesday, April 24, 2019 at 2:49:50 PM UTC-7, philippe DALET wrote:

Hi,

A very simple Pythoncard App to run on Windows or Ubuntu.

breakpoint: PythonCard\components\Imagebutton.py line57

call wx.BitmapButton.init

wheel:

https://www.dropbox.com/s/3k6duczem056znn/PythonCard-0.9.1-py3-none-any.whl?dl=0

Thanks a lot

Philippe.

Le mer. 24 avr. 2019 à 17:14, philippe DALET philippe.dalet@gmail.com a écrit :

Yes of course.
I’ll create a simple application.

Sorry.

Philippe

Le mer. 24 avr. 2019 à 00:22, Robin Dunn robin@alldunn.com a écrit :

I’m not sure in what universe that 109,405 lines of Python code, plus tons of data files, that uses matplotlib and scipy is considered a “small stand-alone sample” but in this universe it isn’t.

Robin

On Tuesday, April 23, 2019 at 1:37:29 PM UTC-7, philippe DALET wrote:

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Robin,

it works fine. Thanks a lot.

Philippe

Le jeu. 25 avr. 2019 à 02:01, Robin Dunn robin@alldunn.com a écrit :

···

This is the problem:

class Image(widget.Widget, StaticBitmap):

...

class ImageButton(image.Image, wx.BitmapButton):

...

You have the ImageButton class deriving from two different widget classes. Not only can you not have a single widget be two different types of widget at the same time, but SIP does not support multiple inheritance of wrapped classes, which is the problem this code runs into first. (The wrong init being called when you call wx.BitmapButton.init) Even if SIP had supported it then there likely would have been errors from wxWidgets or the platform APIs.

If you change the ImageButton class to this then it will work:

class ImageButton(widget.Widget, wx.BitmapButton):

which is apparently what was intended since there is already a call to widget.Widget.init in the code.

Robin

On Wednesday, April 24, 2019 at 2:49:50 PM UTC-7, philippe DALET wrote:

Hi,

A very simple Pythoncard App to run on Windows or Ubuntu.

breakpoint: PythonCard\components\Imagebutton.py line57

call wx.BitmapButton.init

wheel:

https://www.dropbox.com/s/3k6duczem056znn/PythonCard-0.9.1-py3-none-any.whl?dl=0

Thanks a lot

Philippe.

Le mer. 24 avr. 2019 à 17:14, philippe DALET philippe.dalet@gmail.com a écrit :

Yes of course.
I’ll create a simple application.

Sorry.

Philippe

Le mer. 24 avr. 2019 à 00:22, Robin Dunn robin@alldunn.com a écrit :

I’m not sure in what universe that 109,405 lines of Python code, plus tons of data files, that uses matplotlib and scipy is considered a “small stand-alone sample” but in this universe it isn’t.

Robin

On Tuesday, April 23, 2019 at 1:37:29 PM UTC-7, philippe DALET wrote:

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I’m not sure in what universe that 109,405 lines of Python code, plus tons of data files, that uses matplotlib and scipy is considered a “small stand-alone sample”

In case it’s not clear -/ Robin is referring to this:

https://wiki.wxpython.org/MakingSampleApps

And not only does it make it easier for others to hell you, isolating the problematic code is very likely to help you find the solution yourself.

-CHB

···

On Apr 23, 2019, at 3:22 PM, Robin Dunn robin@alldunn.com wrote:

but in this universe it isn’t.

Robin

On Tuesday, April 23, 2019 at 1:37:29 PM UTC-7, philippe DALET wrote:

Robin

Get this file

https://www.dropbox.com/s/0dbsnmkrcfzgegx/avancement.tar.gz?dl=0

untar the file, then launch run.sh.

Philippe

Le lun. 22 avr. 2019 à 17:23, Robin Dunn robin@alldunn.com a écrit :

Philippe,

Can you duplicate the problem in a small stand-alone sample?

Robin

On Sunday, April 21, 2019 at 2:48:31 PM UTC-7, philippe DALET wrote:

Hello robin,

This bug does not come necessarily from wxpython.

With python 3.7.2 on Windows seven, this bug was already present. No more with python 3.7.3.

Philippe.

Le sam. 20 avr. 2019 à 02:14, Robin Dunn robin@alldunn.com a écrit :

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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 wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.