Skip to content

Commit

Permalink
Better comments for EDT queue calls
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed Nov 17, 2022
1 parent 0c813de commit 251977f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/napari_imagej/widgets/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ def ui_setup():
else:
self._ij2_UI_setup()

# Run the setup on the Java GUI Thread
# Queue UI call on the EDT
# TODO: Use EventQueue.invokeLater scyjava wrapper, once it exists
ij().thread().queue(ui_setup)
# Later shows - the GUI is "visible", but the appFrame probably isn't
else:
# Queue UI call on the EDT
# TODO: Use EventQueue.invokeLater scyjava wrapper, once it exists
ij().thread().queue(lambda: self.gui.getApplicationFrame().setVisible(True))

Expand Down Expand Up @@ -175,6 +176,7 @@ def send_chosen_layer(self):
self._show(layer)

def _show(self, layer):
# Queue UI call on the EDT
# TODO: Use EventQueue.invokeLater scyjava wrapper, once it exists
ij().thread().queue(lambda: ij().ui().show(ij().py.to_java(layer)))

Expand Down

0 comments on commit 251977f

Please sign in to comment.