EvolutionGym / evogym-design-tool

Design tool for creating Evolution Gym environments.
https://evolutiongym.github.io/
MIT License
100 stars 10 forks source link

X Error of failed request: BadMatch (invalid parameter attributes) when changing width of GUI #5

Open dmosher42 opened 1 year ago

dmosher42 commented 1 year ago

When I tried to change the width of the tools gui, the program would crash and I would get the following error:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  73 (X_GetImage)
  Serial number of failed request:  29533
  Current serial number in output stream:  29533
Segmentation fault

The solution I found is quite simple. In src/gui.py change

        self.width = mx//4

to

        self.width = mx

For me, this also had the added benefit that the tools gui would start at a width that showed all menu items.

dmosher42 commented 1 year ago

I'm not 100% sure what causes this error. It appears to usually occur if the tool gui width is changed when it's too narrow to see all the gui elements.