@@ -678,10 +678,6 @@ def __init__(self, ax, label, initial = '',
678
678
self .params_to_disable += [key ]
679
679
680
680
self .text = initial
681
-
682
-
683
-
684
-
685
681
self .label = ax .text (0.0 ,0.5 , label ,
686
682
verticalalignment = 'center' ,
687
683
horizontalalignment = 'right' ,
@@ -699,7 +695,6 @@ def __init__(self, ax, label, initial = '',
699
695
self .cursor = self .ax .vlines (0 , 0 , 0 ) #because this is initialized, _render_cursor
700
696
self .cursor .set_visible (False ) #can assume that cursor exists
701
697
702
-
703
698
self .connect_event ('button_press_event' , self ._click )
704
699
self .connect_event ('button_release_event' , self ._release )
705
700
self .connect_event ('motion_notify_event' , self ._motion )
@@ -714,10 +709,7 @@ def __init__(self, ax, label, initial = '',
714
709
self ._lastcolor = color
715
710
716
711
self .capturekeystrokes = False
717
-
718
-
719
-
720
-
712
+
721
713
def _make_text_disp (self , string ):
722
714
return self .ax .text (self .DIST_FROM_LEFT , 0.5 , string ,
723
715
verticalalignment = 'center' ,
@@ -733,8 +725,7 @@ def _rendercursor(self):
733
725
no_text = False
734
726
if (widthtext == "" or widthtext == " " or widthtext == " " ):
735
727
no_text = widthtext == ""
736
- widthtext = ","
737
-
728
+ widthtext = ","
738
729
739
730
wt_disp = self ._make_text_disp (widthtext )
740
731
@@ -746,8 +737,7 @@ def _rendercursor(self):
746
737
if no_text :
747
738
bb [1 , 0 ] = bb [0 , 0 ]
748
739
#hack done
749
- self .cursor .set_visible (False )
750
-
740
+ self .cursor .set_visible (False )
751
741
752
742
self .cursor = self .ax .vlines (bb [1 , 0 ], bb [0 , 1 ], bb [1 , 1 ])
753
743
self .ax .figure .canvas .draw ()
@@ -832,7 +822,6 @@ def _click(self, event):
832
822
self .cursor_index = len (self .text )
833
823
self ._rendercursor ()
834
824
835
-
836
825
def _motion (self , event ):
837
826
if self .ignore (event ):
838
827
return
@@ -856,6 +845,7 @@ def on_text_change(self, func):
856
845
self .change_observers [cid ] = func
857
846
self .cnt += 1
858
847
return cid
848
+
859
849
def on_submit (self , func ):
860
850
"""
861
851
When the user hits enter or leaves the submision box, call this *func* with event
@@ -866,6 +856,7 @@ def on_submit(self, func):
866
856
self .submit_observers [cid ] = func
867
857
self .cnt += 1
868
858
return cid
859
+
869
860
def disconnect (self , cid ):
870
861
"""remove the observer with connection id *cid*"""
871
862
try :
0 commit comments