Hi all
This is a minor problem, on GTK only, that I am sure has only appeared
recently. I cannot pinpoint exactly when it changed, but it would have been
either 2.5.1.5 or 2.5.2.7.
The attached program shows a very simplified version of the structure of my
system. There is a 'menu' frame which provides a menu of options. When an
option is selected, it launches an 'application' frame, which has a parent
of None.
When the user has finished with the application, they can close the frame
directly (eg Alt-F4 or click the top right-hand corner), or they can click
on a 'Close' button, which calls frame.Close(). The effect should be the
same.
If the user has made any changes, a message dialog (with the application
frame as parent) is popped up for confirmation. If the user does not
confirm, the frame must not be closed. The way this is achieved depends on
where it was called from. If called from the button, the button function
does not try to close the window. If called from closing the frame directly,
the close is vetoed.
My problem is that, if the frame is closed directly, the 'menu' frame
re-appears on top of the application frame, and then the message dialog
appears on top of that. GTK seems to think that the frame is already closed,
so it uses the menu frame as the parent of the dialog box (or something like
that).
A further variation is that the application frame can open a dialog box, to
handle a subset of the application. Exactly the same rules apply for closing
the dialog box, but in this case the problem does not occur.
To see this, do the following with the attached program -
From the menu, click 'Application'.
If you close the application frame by either method, it closes without a
problem.
Click 'Application' again, then click 'Change'.
If you now click the 'Close' button, the message dialog appears without a
problem.
If you click the top right corner instead, the message dialog appears
correctly, but the menu frame has reappeared on top of the application menu.
This is not a train smash, but it is confusing for the user, so I hope that
a solution can be found.
Thanks
Frank Millman
fm35.py (4.03 KB)