From eb54dac20092c54228bdd9f227c7ad163bca382d Mon Sep 17 00:00:00 2001 From: "benoit.pin" Date: Mon, 31 Jan 2011 14:13:36 +0000 Subject: [PATCH 1/1] =?utf8?q?Impl=C3=A9mentation=20du=20double=20clic=20s?= =?utf8?q?ur=20la=20s=C3=A9lection=20de=20la=20chanson.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@330 fe552daf-6dbe-4428-90eb-1537e0879342 --- src/minwii/widgets/songfilebrowser.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/minwii/widgets/songfilebrowser.py b/src/minwii/widgets/songfilebrowser.py index f976ce6..6117218 100755 --- a/src/minwii/widgets/songfilebrowser.py +++ b/src/minwii/widgets/songfilebrowser.py @@ -6,6 +6,7 @@ $Id$ $URL$ """ +import pygame from pgu.gui import FileDialog import pgu.gui.basic as basic import pgu.gui.input as input @@ -57,6 +58,8 @@ class FileOpenDialog(FileDialog): self.body.tr() self.body.td(self.list, colspan=4, style=td_style) self.list.connect(CHANGE, self._item_select_changed_, None) + self.list.connect(CLICK, self._check_dbl_click_, None) + self._last_time_click = pygame.time.get_ticks() self.button_ok.connect(CLICK, self._button_okay_clicked_, None) self.body.tr() self.body.td(basic.Label("Fichier"), style=td_style, align=-1) @@ -256,6 +259,13 @@ class FileOpenDialog(FileDialog): self._current_sort = arg self.list.clear() self._list_dir_() + + def _check_dbl_click_(self, arg) : + if pygame.time.get_ticks() - self._last_time_click < 300 : + self._button_okay_clicked_(None) + else : + self._last_time_click = pygame.time.get_ticks() + # utils from unicodedata import decomposition -- 2.20.1