In article <[EMAIL PROTECTED]>, Jeff Cagle <[EMAIL PROTECTED]> wrote:
> So I was trying to pretty up a GUI. It took 20 minutes to write code to > place names in a circle and draw arrows to the names that are related > (actually, the names are filenames, and the arrows represent 'import' or > 'from ... import' statements). > > It's taken a couple of hours to try to clean it up so that the arrows go > up to the bounding box of the text, but not inside. > > Here was the plan: Compute the line that connects the centers of the > text objects. Figure out where that line intersects the bounding boxes > of the texts, and draw the lines to the intersection points instead of > center-to-center. > > It all works ... except that I don't get the right bounding boxes. > Here's the code: it sounds like object with ID 1 may be overlapping all the other objects. Tk's find_closest is primitive in how it handles overlap. Unless you can guarantee that your text objects will never overlap I suggest you find the closest one yourself. Keep a list of object coords and scan through them. If the objects can be moved around then use a callback to update the position. -- Russell _______________________________________________ Tkinter-discuss mailing list [email protected] http://mail.python.org/mailman/listinfo/tkinter-discuss
