[Skencil-commits] r741 - skencil/branches/skencil-0.6/src/Sketch/UI
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Sep 28 01:56:43 CEST 2010
Author: igor_n
Date: 2010-09-28 01:56:43 +0200 (Tue, 28 Sep 2010)
New Revision: 741
Modified:
skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py
Log:
commented lines are removed and code is reformatted
Modified: skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py 2010-09-25 20:12:06 UTC (rev 740)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py 2010-09-27 23:56:43 UTC (rev 741)
@@ -58,10 +58,10 @@
def create_balloon(self, root):
self.root = root
- self.balloon = Toplevel(self.root, name = 'tooltips')
+ self.balloon = Toplevel(self.root, name='tooltips')
self.balloon.withdraw()
self.balloon.overrideredirect(1)
- label = Label(self.balloon, name = 'label', text = 'Tooltip')
+ label = Label(self.balloon, name='label', text='Tooltip')
label.pack()
self.balloon_label = label
@@ -71,22 +71,21 @@
self.balloon.withdraw()
self.balloon_label['text'] = text
- width=self.balloon_label.winfo_reqwidth()
- height=self.balloon_label.winfo_reqheight()
+ width = self.balloon_label.winfo_reqwidth()
+ height = self.balloon_label.winfo_reqheight()
- screenwidth=self.root.winfo_screenwidth()
- screenheight=self.root.winfo_screenheight()
+ screenwidth = self.root.winfo_screenwidth()
+ screenheight = self.root.winfo_screenheight()
- x=self.root.winfo_pointerx()+10
- y=self.root.winfo_pointery()+20
+ x = self.root.winfo_pointerx() + 10
+ y = self.root.winfo_pointery() + 20
- if screenwidth<(x+width):
- x=x-width
+ if screenwidth < (x + width):
+ x = x - width
- if screenheight<(y+height):
- y=y-height-25
+ if screenheight < (y + height):
+ y = y - height - 25
-# x = x - self.balloon_label.winfo_reqwidth() / 2
self.balloon.geometry('%+d%+d' % (x, y))
self.balloon.update()
self.balloon.deiconify()
@@ -102,8 +101,7 @@
widget = self.root.nametowidget(widget_name)
x = widget.winfo_rootx() + widget.winfo_width() / 2
y = widget.winfo_rooty() + widget.winfo_height()
- #y = y + height
- #x = x + width / 2
+
if self.after_id:
print 'after_id in enter'
self.root.after_cancel(self.after_id)
More information about the Skencil-commits
mailing list