X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/898cc352cb6624da41e4befd97a07c99243433a4..25459b1a617cb907d4bebad3a35f308b87fa795a:/src/app/widgets/instrumentselector.py?ds=inline 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