X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/898cc352cb6624da41e4befd97a07c99243433a4..9c9154a1581b81cfc0e9c3cb6d2d17cd7db854d6:/src/app/widgets/instrumentselector.py diff --git a/src/app/widgets/instrumentselector.py b/src/app/widgets/instrumentselector.py index 6935e03..9bafbc3 100755 --- a/src/app/widgets/instrumentselector.py +++ b/src/app/widgets/instrumentselector.py @@ -89,6 +89,13 @@ class InstrumentSelector(pygame.sprite.LayeredDirty, EventHandlerMixin) : self._inflatedTile = tile + @event_handler(pygame.MOUSEBUTTONDOWN) + def selectInstrument(self, event) : + for tile in reversed(self.sprites()[:-1]) : + if tile.rect.collidepoint(*event.pos) : + self.selectedInstrument = tile + self.stop() + break