summaryrefslogtreecommitdiff
path: root/src/core/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-30 20:37:18 +0200
committermathieui <mathieui@mathieui.net>2014-04-30 20:37:18 +0200
commitd859ec2ea19654603075b556094c6b59aad8e73a (patch)
treee9c84ee768c0edb24f4f49695154eb8bad4f4e18 /src/core/core.py
parent4e4ab569cf07fabf76339eeace1f6694f3414eff (diff)
downloadpoezio-d859ec2ea19654603075b556094c6b59aad8e73a.tar.gz
poezio-d859ec2ea19654603075b556094c6b59aad8e73a.tar.bz2
poezio-d859ec2ea19654603075b556094c6b59aad8e73a.tar.xz
poezio-d859ec2ea19654603075b556094c6b59aad8e73a.zip
Add a 'tab_change' event
Diffstat (limited to 'src/core/core.py')
-rw-r--r--src/core/core.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/core.py b/src/core/core.py
index 19eb9b16..4ffb0213 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -1098,12 +1098,15 @@ class Core(object):
Prevents the tab number from going over the total number of opened
tabs, or under 0
"""
+ old = self._current_tab_nb
if value >= len(self.tabs):
self._current_tab_nb = 0
elif value < 0:
self._current_tab_nb = len(self.tabs) - 1
else:
self._current_tab_nb = value
+ if old != self._current_tab_nb:
+ self.events.trigger('tab_change', old, self._current_tab_nb)
### Opening actions ###