* 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: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 970 |
Nodes: | 10 (2 / 8) |
Uptime: | 104:49:24 |
Calls: | 12,740 |
Calls today: | 2 |
Files: | 186,574 |
Messages: | 3,171,672 |