That was the fix!
Thanks,
Craig
···
-----Original Message-----
From: Robert Cragie [SMTP:rcc@jennic.com]
Sent: Monday, May 08, 2000 11:36 AM
To: wxpython-users@wxwindows.org
Subject: RE: [wxPython] GetPyData not working as beforeI remember Robin answered a similar question earlier. See stuff posted
around 26/04/00.I quote his earlier response...
> I just installed the new version and unfortunately I've encountered a
> problem. It appears GetPyData on the wxTreeCtrl doesn't work. The
following
> code:
>
> def OnRightClick(self, event):
> pt = event.GetPosition()
> flag = 0
> item = self.HitTest(pt)
> (xmlnode, name) = self.GetPyData(item)
> self.SelectItem(item)
> .....
>Hit test returns a tuple of two values. The tree item and a flags value.
If you change it to "item = self.HitTest(pt)[0]" it will probably work.> -----Original Message-----
> From: wxpython-users-admin@wxwindows.org
> [mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Cavanaugh, Craig
> Sent: 08 May 2000 17:25
> To: wxpython-users@wxwindows.org
> Subject: [wxPython] GetPyData not working as before
>
>
> This chunk of code was functioning prior to 2.1.15. After I
> updated, I get
> the following error. It's the same for windows and GTK. Has something
in
> the API changed that I'm not aware of, or is this a bug?
>
> def OnRightClick(self, event):
> pt = event.GetPosition(); # get the
> click position
> item = self.tree.HitTest(pt) # find tree item it
> belongs to
> self.tmpAccount = self.tree.GetPyData(item) # need to save the
> parent account
> self.tree.SelectItem(item) # does this need to
> happen ???
> self.PopupMenu(self.popMenu, pt) # display the
> popup menu
> self.tmpAccount = None # clear the temporay
> reference to the account
>
> Traceback (innermost last):
> File "wxAccountSheet.py", line 129, in OnRightClick
> self.tmpAccount = self.tree.GetPyData(item) # need to save the
parent
> account
> File "C:\Program Files\Python\wxPython\controls2.py", line 636, in
> GetPyData
> val = apply(controls2c.wxTreeCtrl_GetPyData,(self,) + _args,
_kwargs)
> TypeError: Type error in argument 2 of wxTreeCtrl_GetPyData. Expected
> _wxTreeItemId_p.
>
> Thanks,
> Craig
>
>
>
> _______________________________________________
> wxPython-users mailing list wxPython-users@wxwindows.org
> http://wxwindows.org/mailman/listinfo/wxpython-users_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users