-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to properly remove a widget from gui #24
Comments
I suppose removing a widget inside its event callback function breaks mouse over iteration by changing its parrent children widget array. Could you test the following, to confirm: store widget in a temporary variable and call |
I tried this and it seems to be fine. I haven't seen any crash after few tries:
The widgets disappear and the scrollarea is properly resized. |
Great. It kind of confirms what I was thinking. Widget destruction must be postponed until event processing finishes. I'll find some time to work on this. Thanks for your report! |
This is a little followup to #23. I'm wondering how can I remove a widget from its parent (completely destroy the widget).
From the comments in the code I suppose I should be using the following to destroy eg. button with label:
However this sometimes throws an error ("Segmentation fault") as can be seen the following GIFs. It seems to be random, sometimes it fails, sometimes it's fine.
By clicking any of the buttons I want to remove them with
KW_DestroyWidget
.... or here
... or here
The error backtrace is always the same:
Test source code:
The text was updated successfully, but these errors were encountered: