What is this error about

Hi, ALL,
I'm trying to modify toolbar demo, but am getting an error.
Could someone please sched some light?

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
wx.version: 3.0.1.0.b20140104 msw (classic)
pid: 3184
Traceback (most recent call last):
  File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",
line 203, in OnButton
    win = TestToolBar(self, self.log)
  File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",
line 121, in __init__
    tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check Tool")
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",
line 3730, in AddCheckTool
    shortHelp, longHelp, clientData)
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",
line 3608, in DoAddTool
    return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)
TypeError: in method 'ToolBarBase_DoAddTool', expected argument 4 of
type 'wxBitmap const &'

The code I'm using is as follows:

        tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp,
"Check Tool")

Thank you in advance.

Why do you have the string "Check Tool" twice? Shouldn't it be only at the
end?

I don't know how 3.0 does it, but it seems that's how it was previously.
And are the copy_bmp and open_bmp actually bitmaps?

···

On Sun, Aug 31, 2014 at 6:39 AM, Igor Korot <ikorot01@gmail.com> wrote:

Hi, ALL,
I'm trying to modify toolbar demo, but am getting an error.
Could someone please sched some light?

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
wx.version: 3.0.1.0.b20140104 msw (classic)
pid: 3184
Traceback (most recent call last):
  File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",
line 203, in OnButton
    win = TestToolBar(self, self.log)
  File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",
line 121, in __init__
    tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check
Tool")
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",
line 3730, in AddCheckTool
    shortHelp, longHelp, clientData)
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",
line 3608, in DoAddTool
    return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)
TypeError: in method 'ToolBarBase_DoAddTool', expected argument 4 of
type 'wxBitmap const &'
>>>

The code I'm using is as follows:

        tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp,
"Check Tool")

Hi,

Hi, ALL,
I'm trying to modify toolbar demo, but am getting an error.
Could someone please sched some light?

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
wx.version: 3.0.1.0.b20140104 msw (classic)
pid: 3184
Traceback (most recent call last):
  File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",
line 203, in OnButton
    win = TestToolBar(self, self.log)
  File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",
line 121, in __init__
    tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check
Tool")
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",
line 3730, in AddCheckTool
    shortHelp, longHelp, clientData)
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",
line 3608, in DoAddTool
    return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)
TypeError: in method 'ToolBarBase_DoAddTool', expected argument 4 of
type 'wxBitmap const &'
>>>

The code I'm using is as follows:

        tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp,
"Check Tool")

Why do you have the string "Check Tool" twice? Shouldn't it be only at the
end?

First string is for the label, second - is a tooltip.
See the documentation of wxToolBar::AddCheckTool().

I don't know how 3.0 does it, but it seems that's how it was previously. And
are the copy_bmp and open_bmp actually bitmaps?

Yes, they are. They are used in that script as bitmaps for previous
tools/buttons.

Thank you.

···

On Sun, Aug 31, 2014 at 11:47 AM, C M <cmpython@gmail.com> wrote:

On Sun, Aug 31, 2014 at 6:39 AM, Igor Korot <ikorot01@gmail.com> wrote:

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

Hi,

>

>

>

>>

>> Hi, ALL,

>> I'm trying to modify toolbar demo, but am getting an error.

>> Could someone please sched some light?

>>

>> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]

>> wx.version: 3.0.1.0.b20140104 msw (classic)

>> pid: 3184

>> Traceback (most recent call last):

>> File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",

>> line 203, in OnButton

>> win = TestToolBar(self, self.log)

>> File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",

>> line 121, in __init__

>> tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check

>> Tool")

>> File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",

>> line 3730, in AddCheckTool

>> shortHelp, longHelp, clientData)

>> File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",

>> line 3608, in DoAddTool

>> return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)

>> TypeError: in method 'ToolBarBase_DoAddTool', expected argument 4 of

>> type 'wxBitmap const &'

>> >>>

>>

>> The code I'm using is as follows:

>>

>> tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp,

>> "Check Tool")

>

>

> Why do you have the string "Check Tool" twice? Shouldn't it be only at the

> end?

First string is for the label, second - is a tooltip.

See the documentation of wxToolBar::AddCheckTool().

You're definitely calling it wrong, maybe you want AddCheckLabelTool?

http://www.wxpython.org/docs/api/wx.ToolBarBase-class.html#AddCheckTool

···

On Sunday, August 31, 2014 12:06:23 PM UTC-7, Igor Korot wrote:

On Sun, Aug 31, 2014 at 11:47 AM, C M <cmpython@gmail.com> wrote:
> On Sun, Aug 31, 2014 at 6:39 AM, Igor Korot <ikorot01@gmail.com> wrote:

>

> I don't know how 3.0 does it, but it seems that's how it was previously. And

> are the copy_bmp and open_bmp actually bitmaps?

Yes, they are. They are used in that script as bitmaps for previous

tools/buttons.

Thank you.

>

>

>

> --

> You received this message because you are subscribed to the Google Groups

> "wxPython-users" group.

> To unsubscribe from this group and stop receiving emails from it, send an

> email to wxpython-users+unsubscribe@googlegroups.com.

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

Nathan,

Hi,

>

>

>

>>

>> Hi, ALL,

>> I'm trying to modify toolbar demo, but am getting an error.

>> Could someone please sched some light?

>>

>> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]

>> wx.version: 3.0.1.0.b20140104 msw (classic)

>> pid: 3184

>> Traceback (most recent call last):

>> File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",

>> line 203, in OnButton

>> win = TestToolBar(self, self.log)

>> File "C:\Program Files\wxPython3.0 Docs and Demos\demo\ToolBar.py",

>> line 121, in __init__

>> tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check

>> Tool")

>> File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",

>> line 3730, in AddCheckTool

>> shortHelp, longHelp, clientData)

>> File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py",

>> line 3608, in DoAddTool

>> return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)

>> TypeError: in method 'ToolBarBase_DoAddTool', expected argument 4 of

>> type 'wxBitmap const &'

>> >>>

>>

>> The code I'm using is as follows:

>>

>> tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp,

>> "Check Tool")

>

>

> Why do you have the string "Check Tool" twice? Shouldn't it be only at the

> end?

First string is for the label, second - is a tooltip.

See the documentation of wxToolBar::AddCheckTool().

You're definitely calling it wrong, maybe you want AddCheckLabelTool?

wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

No, I want AddCheckTool().
So what is the proper call?

Thank you.

···

On Sun, Aug 31, 2014 at 9:54 PM, Nathan McCorkle <nmz787@gmail.com> wrote:

On Sunday, August 31, 2014 12:06:23 PM UTC-7, Igor Korot wrote:

On Sun, Aug 31, 2014 at 11:47 AM, C M <cmpython@gmail.com> wrote:
> On Sun, Aug 31, 2014 at 6:39 AM, Igor Korot <ikorot01@gmail.com> wrote:

>

> I don't know how 3.0 does it, but it seems that's how it was previously. And

> are the copy_bmp and open_bmp actually bitmaps?

Yes, they are. They are used in that script as bitmaps for previous

tools/buttons.

Thank you.

>

>

>

> --

> You received this message because you are subscribed to the Google Groups

> "wxPython-users" group.

> To unsubscribe from this group and stop receiving emails from it, send an

> email to wxpython-users+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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Igor,

Nathan,
...

You're definitely calling it wrong, maybe you want AddCheckLabelTool?

wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

No, I want AddCheckTool().
So what is the proper call?

You show:

   tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check Tool")

But as per the above doc it should be:

     tool = tb.AddCheckTool(60, copy_bmp, open_bmp, "Check Tool")

or better:
     tool = tb.AddCheckTool(wx.ID_ANY, copy_bmp, open_bmp, "Check Tool")

Werner

···

On 9/1/2014 11:48, Igor Korot wrote:

Werner,

Hi Igor,

Nathan,
...

You're definitely calling it wrong, maybe you want AddCheckLabelTool?

wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

No, I want AddCheckTool().
So what is the proper call?

You show:

  tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check Tool")

But as per the above doc it should be:

    tool = tb.AddCheckTool(60, copy_bmp, open_bmp, "Check Tool")

or better:
    tool = tb.AddCheckTool(wx.ID_ANY, copy_bmp, open_bmp, "Check Tool")

This is what I tried to use:

http://wxpython.org/Phoenix/docs/html/ToolBar.html#ToolBar.AddCheckTool

but it looks like Phoenix changed the signature of this function...

Thank you.

···

On Mon, Sep 1, 2014 at 4:20 AM, Werner <wernerfbd@gmx.ch> wrote:

On 9/1/2014 11:48, Igor Korot wrote:

Werner

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

Hi Igor,

···

On 9/1/2014 18:59, Igor Korot wrote:

Werner,

On Mon, Sep 1, 2014 at 4:20 AM, Werner <wernerfbd@gmx.ch> wrote:

Hi Igor,

On 9/1/2014 11:48, Igor Korot wrote:

Nathan,
...

You're definitely calling it wrong, maybe you want AddCheckLabelTool?

wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

No, I want AddCheckTool().
So what is the proper call?

You show:

   tool = tb.AddCheckTool(60, "Check Tool", copy_bmp, open_bmp, "Check Tool")

But as per the above doc it should be:

     tool = tb.AddCheckTool(60, copy_bmp, open_bmp, "Check Tool")

or better:
     tool = tb.AddCheckTool(wx.ID_ANY, copy_bmp, open_bmp, "Check Tool")

This is what I tried to use:

http://wxpython.org/Phoenix/docs/html/ToolBar.html#ToolBar.AddCheckTool

but it looks like Phoenix changed the signature of this function...

Hhm, Phoenix follows the wxWidgets 3.x API and it looks it like it changed in there:
http://docs.wxwidgets.org/3.0/classwx_tool_bar.html#a2e650357ee8872a7443b3c4276d5cbd4

I guess it was changed to have the different AddTools* use a similar API.

Werner