File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -492,14 +492,15 @@ def _init_toolbar(self):
492492 self .set_style (Gtk .ToolbarStyle .ICONS )
493493 basedir = os .path .join (rcParams ['datapath' ], 'images' )
494494
495+ self ._gtk_ids = {}
495496 for text , tooltip_text , image_file , callback in self .toolitems :
496497 if text is None :
497498 self .insert (Gtk .SeparatorToolItem (), - 1 )
498499 continue
499500 fname = os .path .join (basedir , image_file + '.png' )
500501 image = Gtk .Image ()
501502 image .set_from_file (fname )
502- tbutton = Gtk .ToolButton ()
503+ self . _gtk_ids [ text ] = tbutton = Gtk .ToolButton ()
503504 tbutton .set_label (text )
504505 tbutton .set_icon_widget (image )
505506 self .insert (tbutton , - 1 )
@@ -572,6 +573,12 @@ def configure_subplots(self, button):
572573 def _get_canvas (self , fig ):
573574 return self .canvas .__class__ (fig )
574575
576+ def set_history_buttons (self ):
577+ can_backward = self ._nav_stack ._pos > 0
578+ can_forward = self ._nav_stack ._pos < len (self ._nav_stack ._elements ) - 1
579+ self ._gtk_ids ['Back' ].set_sensitive (can_backward )
580+ self ._gtk_ids ['Forward' ].set_sensitive (can_forward )
581+
575582
576583class FileChooserDialog (Gtk .FileChooserDialog ):
577584 """GTK+ file selector which remembers the last file/directory
You can’t perform that action at this time.
0 commit comments