You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Construct-editor Error when quickly browsing the Construct Gallery of the Construct Editor GUI #28
An error appears if the top left panel of the Construct Editor GUI is quickly changed by selecting a construct sample and then pressing a UP or DOWN arrow key, keeping it pressed.
Often (but possibly not always) a KeyError is shown. E.g., the GetSize() or Render() methods of the ObjectRenderer class in wx_construct_editor.py are often impacted.
Example:
File "...\Python39\site-packages\construct_editor\wx_widgets\wx_construct_editor.py", line 54, in GetSize
return self.entry_renderer_helper.get_size(self)
File "...\Python39\site-packages\construct_editor\wx_widgets\wx_obj_view.py", line 376, in get_size
obj_str = self.entry.obj_str if self.entry else ""
File "...\Python39\site-packages\construct_editor\core\entries.py", line 1789, in obj_str
return self.conv_obj_to_str(self.obj)
File "...\Python39\site-packages\construct_editor\core\entries.py", line 252, in obj
obj = obj[p]
Uncaught exception: KeyError: 'days2'
The frequency of the error depends on how many elements are consecutively browsed in sequence (many are needed for the error to occur, not just some) and on the speed of the computer.
I am not quite sure how you are generating the error. I can not reproduce it, but I am not sure if I do it the same like you.
Can you take a screenshot of the panel where you hold down the UP and DOWN buttons?
You either need to browse many construct elements in the gallery (a testing program is needed and this allows checking that the issue occurs every time with fast browsing) or you have to be extremely fast with the ones included in the default sample and perform this testing various times. I will develop a small program that generates the error.
This is a simplified version of main.py. To test it, keep the DOWN arrow key pressed and then the UP arrow key pressed at the end of the travel and repeat this many times. In my Windows 11 setup, Python 3.10.10, I systematically get the error after less than 10 attempts.
This problem almost always occurs with WSL Ubuntu and with Raspberry Pi and makes this framework unusable. There is something that refreshes old values after changing the construct sample or gallery and with Windows it only occurs very rarely.
At the end I found that the issue occurs with wx.Yield(). It looks like Gtk does not like it there. By commenting out that line, the issue disappears.
Activity
timrid commentedon Feb 19, 2023
I am not quite sure how you are generating the error. I can not reproduce it, but I am not sure if I do it the same like you.
Can you take a screenshot of the panel where you hold down the UP and DOWN buttons?
Ircama commentedon Feb 19, 2023
You either need to browse many construct elements in the gallery (a testing program is needed and this allows checking that the issue occurs every time with fast browsing) or you have to be extremely fast with the ones included in the default sample and perform this testing various times. I will develop a small program that generates the error.
Ircama commentedon Feb 20, 2023
This is a simplified version of main.py. To test it, keep the DOWN arrow key pressed and then the UP arrow key pressed at the end of the travel and repeat this many times. In my Windows 11 setup, Python 3.10.10, I systematically get the error after less than 10 attempts.
Ircama commentedon Dec 8, 2023
This problem almost always occurs with WSL Ubuntu and with Raspberry Pi and makes this framework unusable. There is something that refreshes old values after changing the construct sample or gallery and with Windows it only occurs very rarely.
At the end I found that the issue occurs with wx.Yield(). It looks like Gtk does not like it there. By commenting out that line, the issue disappears.
fixed flickering on reload