No, both Bind and bind don’t work!
Traceback (most recent call last):
File “gtgt.py”, line 133, in ?
app = MyApp(0)
File “/usr/lib64/python2.4/site-packages/wxPython/wx.py”, line 1951, in init
_wxStart(self.OnInit)
File “gtgt.py”, line 125, in OnInit
frame_1 = MyFrame(None, -1, “”)
File “gtgt.py”, line 45, in init
self.Bind(wx.EVT_LISTBOX_DCLICK, self.targetDblClick, id=1)
AttributeError: MyFrame instance has no attribute ‘Bind’
I tried lower casing Bind when upper didn’t work, they both fail.
Dan
···
On 9/14/07, jonhattan jonhattan@faita.net wrote:
Dan Bar Dov escribió:
I’m using wxGlade to generate a wxPython app.
When I try to execute the skeleton I getself.bind(wx.EVT_LISTBOX_DCLICK, self.targetDblClick, id=1)
AttributeError: MyFrame instance has no attribute ‘bind’self.Bind ==> B uppercase, as in your code below
I’m running on Fedora Core 6, with all stock pacjages:
Python 2.4.3 (#1, Oct 1 2006, 17:59:36)
wxPython-2.6.3.2-2.fc6Here’s the code that instantiates MyFrame:
class MyFrame(wx.Frame):
def init(self, *args, **kwds):
# begin wxGlade: MyFrame.init
kwds[“style”] = wx.DEFAULT_FRAME_STYLE
wx.Frame.init(self, *args, **kwds)
self.TargetsNotebook = wx.Notebook(self, -1, style=0)
self.targets_pane_1 = wx.Panel(self.TargetsNotebook, -1)self.TargetsList = wx.ListBox(self.targets_pane_1, 1,
choices=[“Target Name”, “”], style= wx.LB_SINGLE|wx.LB_HSCROLL|wx.LB_SORT)
self.AddTarget = wx.Button(self.targets_pane_1
, -1, “Add”)
self.ManageTarget = wx.Button(self.targets_pane_1, -1, “Manage”)
self.DeleteTarget = wx.Button(self.targets_pane_1, -1, “Delete”)
self.StartTarget = wx.Button(self.targets_pane_1, -1, “Start”)
self.StopTarget = wx.Button(self.targets_pane_1, -1, “Stop”)
self.StatusTarget = wx.Button(self.targets_pane_1
, -1, “Status”)
self.frame_1_statusbar = self.CreateStatusBar(1, wx.ST_SIZEGRIP)self.__set_properties() self.__do_layout() self.Bind
(wx.EVT_LISTBOX_DCLICK, self.targetDblClick, id=1)
self.Bind(wx.EVT_BUTTON, self.AddTarget, self.AddTarget) self.Bind(wx.EVT_BUTTON, self.ManageTarget, self.ManageTarget) self.Bind
(wx.EVT_BUTTON, self.DeleteTarget, self.DeleteTarget)
self.Bind(wx.EVT_BUTTON, self.StartTarget, self.StartTarget) self.Bind(wx.EVT_BUTTON, self.StopTarget, self.StopTarget) self.Bind(wx.EVT_BUTTON, self.StatusTarget, self.StatusTarget)
Any ideas?
Thanks,
Dan
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org