@@ -684,10 +684,6 @@ def __init__(self, ax, label, initial = '',
684
684
self .params_to_disable += [key ]
685
685
686
686
self .text = initial
687
-
688
-
689
-
690
-
691
687
self .label = ax .text (0.0 ,0.5 , label ,
692
688
verticalalignment = 'center' ,
693
689
horizontalalignment = 'right' ,
@@ -705,7 +701,6 @@ def __init__(self, ax, label, initial = '',
705
701
self .cursor = self .ax .vlines (0 , 0 , 0 ) #because this is initialized, _render_cursor
706
702
self .cursor .set_visible (False ) #can assume that cursor exists
707
703
708
-
709
704
self .connect_event ('button_press_event' , self ._click )
710
705
self .connect_event ('button_release_event' , self ._release )
711
706
self .connect_event ('motion_notify_event' , self ._motion )
@@ -720,10 +715,7 @@ def __init__(self, ax, label, initial = '',
720
715
self ._lastcolor = color
721
716
722
717
self .capturekeystrokes = False
723
-
724
-
725
-
726
-
718
+
727
719
def _make_text_disp (self , string ):
728
720
return self .ax .text (self .DIST_FROM_LEFT , 0.5 , string ,
729
721
verticalalignment = 'center' ,
@@ -739,8 +731,7 @@ def _rendercursor(self):
739
731
no_text = False
740
732
if (widthtext == "" or widthtext == " " or widthtext == " " ):
741
733
no_text = widthtext == ""
742
- widthtext = ","
743
-
734
+ widthtext = ","
744
735
745
736
wt_disp = self ._make_text_disp (widthtext )
746
737
@@ -752,8 +743,7 @@ def _rendercursor(self):
752
743
if no_text :
753
744
bb [1 , 0 ] = bb [0 , 0 ]
754
745
#hack done
755
- self .cursor .set_visible (False )
756
-
746
+ self .cursor .set_visible (False )
757
747
758
748
self .cursor = self .ax .vlines (bb [1 , 0 ], bb [0 , 1 ], bb [1 , 1 ])
759
749
self .ax .figure .canvas .draw ()
@@ -838,7 +828,6 @@ def _click(self, event):
838
828
self .cursor_index = len (self .text )
839
829
self ._rendercursor ()
840
830
841
-
842
831
def _motion (self , event ):
843
832
if self .ignore (event ):
844
833
return
@@ -862,6 +851,7 @@ def on_text_change(self, func):
862
851
self .change_observers [cid ] = func
863
852
self .cnt += 1
864
853
return cid
854
+
865
855
def on_submit (self , func ):
866
856
"""
867
857
When the user hits enter or leaves the submision box, call this *func* with event
@@ -872,6 +862,7 @@ def on_submit(self, func):
872
862
self .submit_observers [cid ] = func
873
863
self .cnt += 1
874
864
return cid
865
+
875
866
def disconnect (self , cid ):
876
867
"""remove the observer with connection id *cid*"""
877
868
try :
0 commit comments