Skip to content

Commit e7428af

Browse files
committed
focus out event
1 parent e80fd30 commit e7428af

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/navigate/controller/sub_controllers/stage_controller.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,15 @@ def disable_synthetic_stages(self, config):
284284
def bind_position_callbacks(self):
285285
"""Binds position_callback() to each axis, records the trace name so we can
286286
unbind later."""
287+
widgets = self.view.get_widgets()
287288
if not self.position_callbacks_bound:
288289
for axis in ["x", "y", "z", "theta", "f"]:
289290
# add event bind to position entry variables
290-
cbname = self.widget_vals[axis].trace_add(
291-
"write", self.position_callback(axis)
292-
)
293-
self.position_callback_traces[axis] = cbname
291+
widgets[axis].bind("<FocusOut>", self.position_callback(axis))
292+
# cbname = self.widget_vals[axis].trace_add(
293+
# "write", self.position_callback(axis)
294+
# )
295+
# self.position_callback_traces[axis] = cbname
294296
self.position_callbacks_bound = True
295297

296298
def unbind_position_callbacks(self):
@@ -403,6 +405,7 @@ def handler():
403405
# guarantee stage won't move out of limits
404406
if position_val.get() != temp:
405407
position_val.set(temp)
408+
self.position_callback(axis)()
406409

407410
return handler
408411

0 commit comments

Comments
 (0)