[wxPython-users] hyperlinks in a TreeCtrl?

Alec Bennett whatyoulookin at yahoo.com
Tue Dec 11 04:47:06 PST 2007


Or alternatively, if I could get the currently
selected text from my tree control I could launch a
link. I see GetStringSelection(), but I can't get it
to work. Here's my code, with the error afterwards.
Can anyone see what I'm doing wrong? I'd like to see
the text of the currently selected branch in the tree:

self.tree = wx.TreeCtrl(p, 4001, wx.DefaultPosition,
(-1,-1), style=wx.TR_HIDE_ROOT | wx.TR_HAS_BUTTONS |
wx.TR_LINES_AT_ROOT | wx.TR_NO_LINES |
wx.TR_EDIT_LABELS)

self.root = self.tree.AddRoot("Status Messages")

wx.EVT_TREE_ITEM_ACTIVATED (p, self.tree.GetId(),
self.OnTreeClick)


def OnTreeClick(self, event):
...print self.tree.GetStringSelection()

> AttributeError: 'TreeCtrl' object has no attribute
'GetStringSelection'

 



--- Alec Bennett <whatyoulookin at yahoo.com> wrote:

> I'm trying to make some links clickable in a
> TreeCtrl
> and wondering if there's some established way to do
> this?
> 
> Searching around Google I found customtreectrl, but
> I
> can't figure out how to implement it. 
> 
>
http://www.wxpython.org/docs/api/wx.lib.customtreectrl-module.html
> 
> Anyway, if anyone has any tips, definitely invited.
> 
> 
> 
> 
> 
> 
>      
>
____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now. 
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail:
> wxPython-users-help at lists.wxwidgets.org
> 
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping




More information about the wxpython-users mailing list