Robin Dunn:
I have post this before, but This sample code still doesn't work.
OnTreeTooltip() method is called but I cannot see any tooltips, :-< .
In a previous post, Robin said this works for him, could anybody else test the code?
python2.4, wxpython2.5.4.1-ansi, WinXP
···
##=====================================
import wx
from wx.gizmos import TreeListCtrl
class MyApp(wx.App):
def OnInit(self):
frame = wx.Frame(None, -1, "TreeCtrl Tooltips")
self.tree = TreeListCtrl(frame, -1)
self.tree.AddColumn('main')
root = self.tree.AddRoot("r00t")
c1 = self.tree.AppendItem(root, "Topic 1")
c1a = self.tree.AppendItem(c1, "Item 1")
c2 = self.tree.AppendItem(root, "Topic 2")
c3 = self.tree.AppendItem(root, "Topic 3")
c3a = self.tree.AppendItem(c3, "Item 1")
c3b = self.tree.AppendItem(c3, "Item 2")
c3c = self.tree.AppendItem(c3, "Item 3")
c3d = self.tree.AppendItem(c3, "Item 4")
self.tree.Expand(c1)
self.tree.Expand(c3)
self.tree.SelectItem(c1)
frame.Show(True)
self.SetTopWindow(frame)
## this doesn't work
self.tree.Bind(wx.EVT_TREE_ITEM_GETTOOLTIP,self.OnTreeTooltip)
## this doesn't work either
## self.tree.GetMainWindow().Bind(wx.EVT_TREE_ITEM_GETTOOLTIP,self.OnTreeTooltip)
return True
def OnTreeTooltip(self, event):
## this method is never called!
print "Tool tip!" #debug
itemtext = self.tree.GetItemText(event.GetItem())
event.SetToolTip("This is a ToolTip for %s!" % itemtext)
event.Skip()
app = MyApp(0)
app.MainLoop()
##=====================================
======= 2005-04-05 01:23:45 Robin Dunn wrote: =======
Hi all,
wxWidgets 2.5.5 was released this morning, so I am going to be shooting
for a wxPython 2.5.5.x release this week. If you have any contribs or
patches or whatever that you would like to get into this release then
please send them to me ASAP.The 2.6.0 release will probably also be happening real soon, in a couple
weeks if wxWidgets folks stay on track.--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-dev-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help@lists.wxwidgets.org.
= = = = = = = = = = = = = = = = = = = =
Bruce Who
HuXuZhao@hotmail.com
2005-04-06