File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Original file line number Diff line number Diff line change @@ -492,14 +492,15 @@ def _init_toolbar(self):
492
492
self .set_style (Gtk .ToolbarStyle .ICONS )
493
493
basedir = os .path .join (rcParams ['datapath' ], 'images' )
494
494
495
+ self ._gtk_ids = {}
495
496
for text , tooltip_text , image_file , callback in self .toolitems :
496
497
if text is None :
497
498
self .insert (Gtk .SeparatorToolItem (), - 1 )
498
499
continue
499
500
fname = os .path .join (basedir , image_file + '.png' )
500
501
image = Gtk .Image ()
501
502
image .set_from_file (fname )
502
- tbutton = Gtk .ToolButton ()
503
+ self . _gtk_ids [ text ] = tbutton = Gtk .ToolButton ()
503
504
tbutton .set_label (text )
504
505
tbutton .set_icon_widget (image )
505
506
self .insert (tbutton , - 1 )
@@ -572,6 +573,12 @@ def configure_subplots(self, button):
572
573
def _get_canvas (self , fig ):
573
574
return self .canvas .__class__ (fig )
574
575
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
+
575
582
576
583
class FileChooserDialog (Gtk .FileChooserDialog ):
577
584
"""GTK+ file selector which remembers the last file/directory
You can’t perform that action at this time.
0 commit comments