fixed possible bug when using line and col input widgets on bottomt right of editor

This commit is contained in:
2026-07-04 19:42:13 +02:00
parent 25217f73fe
commit 72ea80082e
+6 -8
View File
@@ -1369,27 +1369,26 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda
def column_line_widgets_changed_event( self, data=None ): def column_line_widgets_changed_event( self, data=None ):
page = self.main_notebook.get_current_page( ) page = self.main_notebook.get_current_page( )
textview = None
newline = None
newcol = None
if page == 0: if page == 0:
textview = self.experiment_script_textview textview = self.experiment_script_textview
column_indicator = self.experiment_script_column_indicator
newline = self.experiment_script_line_indicator.get_value_as_int( ) - 1 newline = self.experiment_script_line_indicator.get_value_as_int( ) - 1
newcol = self.experiment_script_column_indicator.get_value_as_int( ) - 1 newcol = column_indicator.get_value_as_int( ) - 1
elif page == 1: elif page == 1:
textview = self.data_handling_textview textview = self.data_handling_textview
column_indicator = self.data_handling_column_indicator
newline = self.data_handling_line_indicator.get_value_as_int( ) - 1 newline = self.data_handling_line_indicator.get_value_as_int( ) - 1
newcol = self.data_handling_column_indicator.get_value_as_int( ) - 1 newcol = column_indicator.get_value_as_int( ) - 1
else: else:
print("unknown line/column selector") print("unknown line/column selector")
return False
textbuffer = textview.get_buffer( ) textbuffer = textview.get_buffer( )
new_place = textbuffer.get_iter_at_line( newline ) new_place = textbuffer.get_iter_at_line( newline )
if not newcol > new_place.get_chars_in_line( ): if not newcol > new_place.get_chars_in_line( ):
new_place.set_line_offset( newcol ) new_place.set_line_offset( newcol )
else: else:
self.__dict__[ text_name + "_column_indicator" ].set_value( 1 ) column_indicator.set_value( 1 )
if len( textbuffer.get_selection_bounds( ) ) != 0: if len( textbuffer.get_selection_bounds( ) ) != 0:
textbuffer.move_mark_by_name( "insert", new_place ) textbuffer.move_mark_by_name( "insert", new_place )
else: else:
@@ -3048,7 +3047,6 @@ class MonitorWidgets:
# Statistics activated? # Statistics activated?
if (self.display_statistics_checkbutton.get_active( ) and if (self.display_statistics_checkbutton.get_active( ) and
in_result.uses_statistics( ) and in_result.ready_for_drawing_error( )): in_result.uses_statistics( ) and in_result.ready_for_drawing_error( )):
for i in range( chans ): for i in range( chans ):
err = in_result.get_yerr( i ) err = in_result.get_yerr( i )
if moving_average is not None: if moving_average is not None: