Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toolbar.py
diff options
context:
space:
mode:
authorMarc Maurer <uwog@uwog.net>2007-07-12 22:23:29 (GMT)
committer Marc Maurer <uwog@uwog.net>2007-07-12 22:23:29 (GMT)
commitce3b836f4b95558ee456ec3290aa8f2dae75b121 (patch)
tree3f9e9a877af9ca6a626d024010ac609e10ad8830 /toolbar.py
parent2c469bdd086d86a4cf1d741076fa88c3e5ff2435 (diff)
Connect to the zoom signal to show the correct zoom level
Diffstat (limited to 'toolbar.py')
-rw-r--r--toolbar.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/toolbar.py b/toolbar.py
index bc49460..ce65ab7 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -299,9 +299,6 @@ class ViewToolbar(gtk.Toolbar):
gtk.Toolbar.__init__(self)
self._abiword_canvas = abiword_canvas
-
- # we can't use abiword_canvas.get_zoom_percentage() yet, as the frame is
- # not fully initialized
self._zoom_percentage = 0;
self._zoom_in = ToolButton('stock-zoom-in')
@@ -363,13 +360,18 @@ class ViewToolbar(gtk.Toolbar):
self._abiword_canvas.connect("page-count", self._page_count_cb)
self._abiword_canvas.connect("current-page", self._current_page_cb)
+ self._abiword_canvas.connect("zoom", self._zoom_cb)
def set_zoom_percentage(self, zoom):
self._zoom_percentage = zoom
- #print 'new zoom percentage:',self._zoom_percentage
self._abiword_canvas.set_zoom_percentage(self._zoom_percentage)
- # update out spinner TODO: should be handled by a callback from the abicanvas
- self._zoom_spin.set_value(zoom)
+
+ def _zoom_cb(self, canvas, zoom):
+ self._zoom_spin.handler_block(self._zoom_spin_id)
+ try:
+ self._zoom_spin.set_value(zoom)
+ finally:
+ self._zoom_spin.handler_unblock(self._zoom_spin_id)
def _zoom_in_cb(self, button):
if self._zoom_percentage == 0: