diff --git a/py/canvassedpile.py b/py/canvassedpile.py index 78fabb7..6364085 100644 --- a/py/canvassedpile.py +++ b/py/canvassedpile.py @@ -43,7 +43,7 @@ def remove(self, window): def find_bounds(self): xs = [] ys = [] - for window in self.windows: + for window in self.mngd_windows: xs.append(window.x) ys.append(window.y) diff --git a/py/canvassedwindow.py b/py/canvassedwindow.py index 59da89d..3daa327 100644 --- a/py/canvassedwindow.py +++ b/py/canvassedwindow.py @@ -9,7 +9,7 @@ # Internal imports from managedwindow import ManagedWindow -from config import WIDTH, HEIGHT +from config import WIDTH, HEIGHT, is_in_bar class CanvassedWindow(ManagedWindow, MTScatterImage): """Subclasses ManagedWindow and MTScatterImage to bring the abstract concept @@ -41,5 +41,7 @@ def __init__(self, **kwargs): # def on_touch_up(self, touchlist, touchID, x, y): - print "hey, touch up: ",self.name, touchlist, touchID, x, y + if is_in_bar(x,y): + print "Yep, in the bar!" + #print "hey, touch up: ",self.name, touchlist, touchID, x, y \ No newline at end of file diff --git a/py/config.py b/py/config.py index 6f8789e..12d3ea2 100644 --- a/py/config.py +++ b/py/config.py @@ -1,4 +1,18 @@ """Constants and other similar configuration.""" WIDTH = 1024 -HEIGHT = 768 \ No newline at end of file +HEIGHT = 768 +BARSIZE=200 +BARLOC="top" + +def is_in_bar(x, y): + if BARLOC=="top": + return (y>HEIGHT-BARSIZE and y0 and yWIDTH-BARSIZE and x0 and x + + id="filter3193" + x="-0.0083428421" + width="1.0166857" + y="-0.11987679" + height="1.2397536"> + stdDeviation="1.9335596" + id="feGaussianBlur3195" /> @@ -151,26 +162,34 @@ sodipodi:rx="828.57141" sodipodi:ry="241.42857" d="M 1237.1429,-7.7142859 A 828.57141,241.42857 0 1 1 -419.99997,-7.7142859 A 828.57141,241.42857 0 1 1 1237.1429,-7.7142859 z" - transform="translate(103.42856,0)" /> + transform="translate(211.99999,-362.85714)" /> the tactus project + sodipodi:role="line">the tactus navigator project the tactus project + y="728">the tactus navigator project + diff --git a/py/windowpile.py b/py/windowpile.py index 1b785f8..3ad4568 100644 --- a/py/windowpile.py +++ b/py/windowpile.py @@ -62,7 +62,7 @@ class WindowPile: """An collection of 0 or more ManagedWindows, manipulated as a group.""" def __init__(self, managedwindows=None): - self.windows = set() + self.mngd_windows = set() if managedwindows != None: # connect each of the given ManagedWindows to this pile. @@ -82,7 +82,7 @@ def add(self, window): raise AlreadyPiledError(self, window) window.register_pile(self) - self.windows.add(window) + self.mngd_windows.add(window) def reassign(self, window): """Reassign a window already assigned to another pile to this pile.""" @@ -103,11 +103,11 @@ def remove(self, window): raise WindowNotManagedError(window) if window.pile != self: raise NotMyChildError(self, window) - if window not in self.windows: + if window not in self.mngd_windows: raise NotMyChildError(self, window) window.pile = None - self.windows.remove(window) + self.mngd_windows.remove(window) def update_child_icon(self, window): """Callback called by child window upon noticing its icon changed."""