Closed sudipshil9862 closed 1 year ago
Solution:
so what I did, I scheduled this dialog.close()
code lately so that every operations will be complete before this...GLib.idle_add()
schedules the function call to be executed in the main event loop, after all pending events have been processed. I calculated already that the time complexity and this delay should be very negligible. So, dialog will close immediately.
Note:
Have to import from gi.repository import GLib
The reason why the
parent.set_default_size(300, 200)
line doesn't work when I call dialog.close() immediately after it is becausedialog.close()
closes the dialog window, as the dialog and its widgets are destroyed and no longer exist... and if I don't calldialog.close()
immediately afterparent.set_default_size(300, 200)
, then theparent.set_default_size(300, 200)
code will work because the widgets of the dialog still exist and are still accessible cause the dialog object itself is still alive...