-
Notifications
You must be signed in to change notification settings - Fork 459
Closing main window throws error and crashes the app #673
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
Comments
@robertalexa, hi, could you please post a small example app that demonstrates this crash. It doesn't have to be fancy, just something I can copy and paste and run to show the behavior you are experiencing. |
I tried with create a sample app with the information given by @robertalexa as follows: The following code will not reproduce the issue with ttkbootstrap 1.13.8 on Windows 11.
|
Please provide minimum working reproducible demo/sample script. |
Hey @israel-dryer @TheDemonGuard Thank you both for getting back to me. I have now managed to put together a super trimmed down version and identified the culprit to be related to the Scrollble Frame. I am attaching a zip file with the app. Again, for transparency, here is the PR that tried to deal with some issues with Scrollable - i suspect this to have contributed to the issue. Let me know your thoughts |
Thank you for providing the reproducible working sample script. |
I think the issue is that we are specifying "master=self.container" instead of "master=master" for the constructor "super().init" |
Fix for israel-dryer#673. Need to specify the root container for the super constructor. (Not an instance frame.)
Made PR #674 for this fix. |
By the way, for additional information, |
@TheDemonGuard, app = ttk.Window()
sf = ScrolledFrame(app, autohide=True)
sf.pack(fill=BOTH, expand=YES, padx=10, pady=10)
for x in range(20):
ttk.Checkbutton(sf, text=f"Checkbutton {x}").pack(anchor=W)
app.mainloop() This has come up before, and I think the problem is in the If you could make this update and test it, then let me know if you see any issues on your end. If you create a PR for it I will approve and merge. Here is the #656 example: import ttkbootstrap as ttk
from ttkbootstrap.dialogs.dialogs import Messagebox
def on_close():
response=Messagebox.show_question("exit?", title="exit?", buttons=["Yes", "No"])
if response == "Yes": # response = None immediately after prev line; msgbox still showing
# will never get here, since after clicking Yes (or No), the above call will not return the clicked button,
# since it already returned None
root.destroy()
root=ttk.Window(title="test msgbox", resizable=(True, True),)
root.protocol('WM_DELETE_WINDOW', on_close)
root.mainloop() |
Thank you for in-depth insight. I will change and check the behavior. |
Update the "destroy" function to fix israel-dryer#673 issue. This prevents child component from destroying its super component.
Desktop (please complete the following information):
ttkbootstrap==1.13.8
Ubuntu 24.04
Python 3.11
Describe the bug
Currently bumping up from ttkbootstrap 1.10.1 to 1.13.8
When closing the root window (top corner X button), the application crashes with the following error:
https://pastebin.com/fvBxWwj7
(Had to upload it to pastebin because it was too long going over this textfield's max length)
Worth noting is that I use a confirmation window when pressing the X button, asking to confirm if the user wants to close the app - just in case this is meaningful.
I have noticed this PR #650 but I am unsure whether this could be the culprit.
Any input would be greatly appreciated
To Reproduce
Confirmation window code, if you believe it to be relevant:
Expected behavior
No response
Screenshots
Screenshot showing the confimation modal
Additional context
No response
The text was updated successfully, but these errors were encountered: