diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-05-28 00:26:14 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-05-28 00:26:14 (GMT) |
commit | 097e0e25e04db0855298c0ed92ba7c9ed306c5e3 (patch) | |
tree | f1603bd0218e65cc7d3388e8ef1a8dd2abc652f9 | |
parent | d0a428cbf055feaddcd8473a712f295835220785 (diff) |
Selecting a frame always
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | frames_list.py | 11 |
2 files changed, 10 insertions, 4 deletions
@@ -1,8 +1,7 @@ New functions: - Save data in journal - Select time between frames - - Select the frames when the activitie loads them. Fixes: - Enable drag and drop between frames. Bugs: - Void. + - Doesn't scroll to the seleceted item diff --git a/frames_list.py b/frames_list.py index 3286e3d..5df5ba6 100644 --- a/frames_list.py +++ b/frames_list.py @@ -53,7 +53,13 @@ class FramesList(gtk.ScrolledWindow): model.remove(_iter) count = 1 for i in self.store: - i[0] = count + print i + selected = False + if i[0] != count: + i[0] = count + if not selected: + self.selection.select_iter(_iter) + selected = True count += 1 self.frames = count - 1 @@ -67,7 +73,8 @@ class FramesList(gtk.ScrolledWindow): preview_pixbuf = pixbuf.scale_simple(200, 200 * height / width, gtk.gdk.INTERP_TILES) - self.store.append([self.frames, preview_pixbuf]) + _iter = self.store.append([self.frames, preview_pixbuf]) + self.selection.select_iter(_iter) if self._animation and not self._animation_connected: self._animation.connect("current-frame-updated", self._select_frame) self._animation_connected = True |