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
The reason why the parent.set_default_size(300, 200) line doesn't work when I call dialog.close() immediately after it is because dialog.close() closes the dialog window, as the dialog and its widgets are destroyed and no longer exist...
and if I don't call dialog.close() immediately after parent.set_default_size(300, 200), then the parent.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...
The text was updated successfully, but these errors were encountered:
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
sudipshil9862
changed the title
After dialog's 'OK' response, main gtk window won't change it's size wit content.
After dialog's 'OK' response, main gtk window won't change it's window-size with content.
Feb 23, 2023
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 call
dialog.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...The text was updated successfully, but these errors were encountered: