According to the Tix documentation online, HList has an info_bbox() method 
which returns the bounding box of a given item in the HList.  However, when I 
try to call this method, I get an attribute error.  Looking at Tix.py I see 
that info_bbox() is not implemented.

Hazarding a chance (mostly by looking at the other method implementation) I see 
if I can define it myself.

def info_bbox( self, entry ):
   return [ int(pos) for pos in self.tk.call( self._w, 'info', 'bbox', 
entry).split() ]

When I use this implementation it works.  Why's info_bbox() been left out of 
HList?

I can't formulate a work-around for what I'm trying to do.  I need info_bbox().

Here's why:

I'm currently working on a project which involves some fairly complex GUIs.  It 
displays data in the form of an outline which the user can edit, it also 
generates web pages.  To allow a natural feel to editing the order of the items 
in the outline, I decided to make use of the Tkinter drag and drop module: 
Tkdnd.  To do this correctly, I need to do a bit of arithmetic with screen 
coordinates while in a drag operation  (so I can change the cursor during the 
drag) so that I can determine if my current drag position (potential drop 
position) is above, below or as a child of some other item in the outline.  The 
easiest way to do this is to get the bounding box of the nearest items.


Thanks,
Ron
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to