From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2005-12-13 17:30:40
|
Could someone confirm that if you add a tool tip to the tree control via the resource editor, it doesn't actually work? I've held the mouse over the component every way possible but nothing seems to appear. If this has already been fixed in 0.8.2 then apologies - I haven't got CVS access set up yet (really must get around to it...). Neil |
From: Alex T. <al...@tw...> - 2005-12-13 19:55:07
|
XXXXXXXXXXX wrote: > Could someone confirm that if you add a tool tip to the tree control > via the resource editor, it doesn't actually work? I've held the mouse > over the component every way possible but nothing seems to appear. > > If this has already been fixed in 0.8.2 then apologies - I haven't got > CVS access set up yet (really must get around to it...). > Works ok for me : PythonCard version: cvs latest wxPython version: 2.5.3.1 Python version: 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] Platform: win32 You should be able to get from CVS using anonymous cvs, so shouldn't be a lot of setup involved. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.13/199 - Release Date: 13/12/2005 |
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2005-12-14 23:03:10
|
On 13/12/05 19:55, Alex Tweedly wrote: > Works ok for me : > > PythonCard version: cvs latest > wxPython version: 2.5.3.1 > Python version: 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit > (Intel)] > Platform: win32 > > You should be able to get from CVS using anonymous cvs, so shouldn't be > a lot of setup involved. Thanks for checking. I've got the same setup here except for the PythonCard version. But I was a bit hasty in my analysis...it appears that the tool tip stops working as soon as I let the pointer cross the actual tree element within the control. If I keep the pointer within the blank area of the control then I can move it onto other controls and back and the tip reappears. Touch the tree...tip no more. I'll try upgrading like you suggest. -- XXXXXXXXXXX |
From: Alex T. <al...@tw...> - 2005-12-15 12:16:42
|
XXXXXXXXXXX wrote: > Thanks for checking. I've got the same setup here except for the > PythonCard version. > > But I was a bit hasty in my analysis...it appears that the tool tip > stops working as soon as I let the pointer cross the actual tree > element within the control. If I keep the pointer within the blank > area of the control then I can move it onto other controls and back > and the tip reappears. Touch the tree...tip no more. > Oh - you mean you put actual data in it :-) I didn't get that far - just created a tree control and checked that a tooltip then worked. > I'll try upgrading like you suggest. Won't help. It's not a bug, it's a feature :-) At least on Windows, you can set the tooltip individually for each item (from the WX docs it does look as though this is Windows only, but I'm not in a position to try it on other systems just now). This isn't exposed through PythonCard, so you need to use the wx event system directly. I changed the minimalTree sample as below (changed line and section marked in comments). The "OnItemExpanded" isn't needed - but it was the one I used for first experiments. For this example, I just always set the same tooltip, but you could customize > #!/usr/bin/python > > """ > __version__ = "$Revision: 1.6 $" > __date__ = "$Date: 2004/05/05 16:53:27 $" > """ > > from PythonCard import model > import wx -- ADDED THIS LINE > > # events > # itemActivated, itemExpanding, itemExpanded, > # selectionChanging, selectionChanged > > class Minimal(model.Background): > > def on_initialize(self, event): > tree = self.components.tree > root = tree.addRoot("1") > tree.setItemHasChildren(root, 1) > tree.selectItem(root) > -- START OF NEW SECTION > self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded, > self.components.tree) > self.Bind(wx.EVT_TREE_ITEM_GETTOOLTIP, self.OnItemSetTooltip, > self.components.tree) > > def OnItemExpanded(self, event): > print "expanded", event.GetItem() > pass > > def OnItemSetTooltip(self, event): > print "gettooltip", event.GetItem() > event.SetToolTip("this is the new tooltip for all items") > pass > -- END OF NEW SECTION > > def on_tree_itemExpanding(self, event): > tree = self.components.tree > item=event.item > # This event can happen twice in the self.Expand call > if tree.isExpanded(item): > return > obj = int(tree.getItemText(item)) > if tree.getChildrenCount(item, 0) == 0: > lst = [obj * 2, (obj *2) + 1] > for o in lst: > new_item = tree.appendItem(item, str(o)) > tree.setItemHasChildren(new_item, 1) > event.skip() > > > if __name__ == '__main__': > app = model.Application(Minimal) > app.MainLoop() -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/2005 |
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2005-12-15 19:17:22
|
On 15/12/05 12:16, Alex Tweedly wrote: > Oh - you mean you put actual data in it :-) :-) A tree-less tree control... > I didn't get that far - just created a tree control and checked that a > tooltip then worked. > >> I'll try upgrading like you suggest. > > > Won't help. It's not a bug, it's a feature :-) > > At least on Windows, you can set the tooltip individually for each item > (from the WX docs it does look as though this is Windows only, but I'm > not in a position to try it on other systems just now). Wha...different tooltips per item! Actually...now that I think about it...I can't think of any use for one tooltip per item. But thanks for solving the mystery. I just need to follow your example and apply the same tooltip to all items. I can't check whether the same applies to OSX either, since my iBook's motherboard recently kicked the bucket :-( -- XXXXXXXXXXX |
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2006-06-05 15:11:18
|
On 15/12/05 19:17, XXXXXXXXXXX wrote: > On 15/12/05 12:16, Alex Tweedly wrote: > >> Oh - you mean you put actual data in it :-) > > :-) A tree-less tree control... > >> I didn't get that far - just created a tree control and checked that a >> tooltip then worked. >> >>> I'll try upgrading like you suggest. >> >> >> Won't help. It's not a bug, it's a feature :-) >> >> At least on Windows, you can set the tooltip individually for each >> item (from the WX docs it does look as though this is Windows only, >> but I'm not in a position to try it on other systems just now). > > Wha...different tooltips per item! > > Actually...now that I think about it...I can't think of any use for one > tooltip per item. But thanks for solving the mystery. I just need to > follow your example and apply the same tooltip to all items. > > I can't check whether the same applies to OSX either, since my iBook's > motherboard recently kicked the bucket :-( Well, I thought I'd go for the record on the longest gap between messages in a thread :-) Finally got around to applying the tooltip modification...thanks Alex. I also got a chance to test this out on OSX. Those WX docs appear to be correct - you can't set the tooltips for individual tree items in OSX. But it does mean that the OSX version doesn't suffer from the bug...er...feature whereby the tooltip for the entire control stops working once you mouse over one if its items. -- XXXXXXXXXXX |
From: Alex T. <al...@tw...> - 2006-06-05 18:07:30
|
XXXXXXXXXXX wrote: > >Well, I thought I'd go for the record on the longest gap between >messages in a thread :-) > >Finally got around to applying the tooltip modification...thanks Alex. > >I also got a chance to test this out on OSX. Those WX docs appear to be >correct - you can't set the tooltips for individual tree items in OSX. >But it does mean that the OSX version doesn't suffer from the >bug...er...feature whereby the tooltip for the entire control stops >working once you mouse over one if its items. > > Well, it may have been a long gap, but you sent this at just the right time. I had found a use for item-specific tooltips, and had planned to implement that sometime in the next week. I had forgotten this was Windows only - now that you've reminded me of that restriction, I'll either not implement it at all, or move its priority (way) down and do it later. btw - my plan was to use it for the items in the sizer-tree in the layoutEditor. Each item (sizer, spacer or component) in the tree has various properties associated with layout; currently you can view (or edit) these with a context-click and menu selection, and I thought it would be convenient to be able to simply hover the mouse over an item and have the tooltip display its properties. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.8.1/355 - Release Date: 02/06/2006 |
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2006-06-08 17:49:26
|
On 5/6/06 19:07, Alex Tweedly wrote: > I had forgotten this was Windows only - now that you've reminded me of > that restriction, I'll either not implement it at all, or move its > priority (way) down and do it later. It sounds like a tiny but useful time saver, so I'd vote for putting it in eventually, even if it's Windows-only. -- XXXXXXXXXXX |