[wxPython] ToolBar event has no GetID attribute

Pertinent (I think) snippets of my code follow:

class MyFrame(wxFrame):
        def __init__(self, parent, id, title):
                #Call the base class to do the real work
                wxFrame.__init__(self, parent, id, title,
wxDefaultPosition,wxSize(400, 400))
                [...]
self.diagTB = self.CreateToolBar(wxTB_HORIZONTAL)

                self.diagTB.AddTool(97, wxBitmap("images/select.bmp",
wxBITMAP_TYPE_BMP), isToggle = true, shortHelpString = "Select",
longHelpString = "Select
and manipulate objects")
                self.diagTB.AddTool(99, wxBitmap("images/q.bmp",
wxBITMAP_TYPE_BMP), isToggle = true, shortHelpString = "Question object",
longHelpString = "Add question objects to diagram")
                [...]
                EVT_TOOL_RANGE(self, 97, 105, self.OnDiagToolClick)
                self.diagTB.ToggleTool(97, true)

                self.diagTB.Realize()

        def OnDiagToolClick(self, event):
                id = event.GetID()

And when the above line is executed, I get the following:
Traceback (most recent call last):
  File "dbadmin.py", line 276, in OnDiagToolClick
    id = event.GetID()
AttributeError: 'wxCommandEventPtr' instance has no attribute 'GetID'

What is it that I am doing wrong?

Thanks for your time.

Alexander

And when the above line is executed, I get the following:
Traceback (most recent call last):
  File "dbadmin.py", line 276, in OnDiagToolClick
    id = event.GetID()
AttributeError: 'wxCommandEventPtr' instance has no attribute 'GetID'

What is it that I am doing wrong?

It's GetId().

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

> What is it that I am doing wrong?

It's GetId().

Thanks, Robin, for this and wxPython. I cannot believe I missed that! I even
looked at the wxPython source to see if I could figure out my problem. My
apologies for adding clutter to the list and wasting time.

No need to apologize. I got bit by that once also. It wouldn't surprise me
if that was a pretty common typo.

···

---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."

-----Original Message-----
From: wxpython-users-admin@lists.wxwindows.org
[mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of Alexander
Garden
Sent: Tuesday, August 07, 2001 12:21 PM
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython] ToolBar event has no GetID attribute

> What is it that I am doing wrong?

It's GetId().

Thanks, Robin, for this and wxPython. I cannot believe I missed that! I even
looked at the wxPython source to see if I could figure out my problem. My
apologies for adding clutter to the list and wasting time.

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users