diff options
Diffstat (limited to 'Jam/Block.py')
-rw-r--r-- | Jam/Block.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Jam/Block.py b/Jam/Block.py index c86a53b..adc487a 100644 --- a/Jam/Block.py +++ b/Jam/Block.py @@ -135,6 +135,9 @@ class Block(): self.active = state self.invalidate_rect( not self.dragging ) + if self.child: + self.child.setActive( state ) + def button_press( self, event ): if event.y < self.y or event.y > self.endY: @@ -411,6 +414,17 @@ class Loop(Block): def _doButtonPress( self, event ): # we were hit with a button press pass + def button_release( self, event ): + if not self.dragging: + if self.active: + root = self.getRoot() + self.owner.deactivateLoop( root.child ) + else: + root = self.getRoot() + if root.type == Instrument: # must be attached to an instrument + self.owner.activateLoop( root.child ) + Block.button_release( self, event ) + def _doDraw( self, startX, startY, stopX, stopY, pixmap ): y = max( startY, self.y ) endY = min( stopY, self.endY ) |