[Skencil-devel] [Skencil-commits] r737 - skencil/branches/skencil-0.6/src/Sketch/UI
Bernhard Herzog
bh at intevation.de
Mon Sep 27 13:01:04 CEST 2010
> Modified: skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py
> ===================================================================
> --- skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py 2010-09-23 12:02:00 UTC (rev 736)
> +++ skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py 2010-09-24 10:33:14 UTC (rev 737)
> @@ -70,7 +70,23 @@
> self.last_widget = widget_name
> self.balloon.withdraw()
> self.balloon_label['text'] = text
> - x = x - self.balloon_label.winfo_reqwidth() / 2
> +
> + width=self.balloon_label.winfo_reqwidth()
> + height=self.balloon_label.winfo_reqheight()
> +
> + screenwidth=self.root.winfo_screenwidth()
> + screenheight=self.root.winfo_screenheight()
> +
> + x=self.root.winfo_pointerx()+10
> + y=self.root.winfo_pointery()+20
> +
> + if screenwidth<(x+width):
> + x=x-width
> +
> + if screenheight<(y+height):
> + y=y-height-25
> +
> +# x = x - self.balloon_label.winfo_reqwidth() / 2
There's no need to keep the old code around as comments. Just remove
it. Also, please try to keep the coding style consistent. the new code
is missing lots of spaces around the binary operators.
Bernhard
More information about the Skencil-devel
mailing list