McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 54 forks source link

Plot: PyQtGraph: click on single monitor plots fails #1582

Closed farhi closed 1 month ago

farhi commented 7 months ago

When running a simulation and plotting results, a click on any part of the PyQtGraph window brings an error:

Traceback (most recent call last):
  File "/usr/share/mcxtrace/3.4-20240304/tools/Python/mxplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 388, in <lambda>
    lambda event: click_handler(
                  ^^^^^^^^^^^^^^
  File "/usr/share/mcxtrace/3.4-20240304/tools/Python/mxplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 367, in click_handler
    if int(event.modifiers()) != mod:
       ^^^^^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier'
willend commented 3 months ago

I am afraid the key-modifier stuff needs to be in place courtesy of Windows and macOS - the last commit here renders clicking on the main ui not functional on these systems....