* Mark Summerfield <mark@qtrac.eu>
| I've made a cut-down example shown below.
| If I click the Options button the Options dialog shows as it should. |
And if I click the Options dialog's Close button it is hidden.
No, it's not, it is destroyed (as you requested by)
| ttk::button .optionsForm.closeButton -text Close \
| -command {destroy $::test::optionsForm}
Part of the problem is that you only check for the existence of the
variable, but not of the window it describes. The second time you call test::on_options, the variable exists, but the window does not since it
was destroyed by the closeButton.
| # Hide/show dialog | proc test::on_options {} {
| if {![info exists ::test::optionsForm]} {
I suggest to add
|| ![winfo exists $::test::optionsForm]
in test::on_options (and probably to unify all the different ways to withdraw/destroy the window - Close button, WM_DELETE, Escape).
HTH R'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 192:21:43 |
Calls: | 9,707 |
Calls today: | 2 |
Files: | 13,740 |
Messages: | 6,180,160 |