I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
I must then click the dialog to give it focus.
Is it possible (1) to make the focus go automatically to the
modal dialog if present? (2) to get the focus to the dialog
via the keyboard?
Am 10.10.2025 um 08:07 schrieb Mark Summerfield:
I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
I must then click the dialog to give it focus.
Is it possible (1) to make the focus go automatically to the
modal dialog if present? (2) to get the focus to the dialog
via the keyboard?
grab -global $toplevel
I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
I must then click the dialog to give it focus.
Is it possible (1) to make the focus go automatically to the
modal dialog if present? (2) to get the focus to the dialog
via the keyboard?
I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
I must then click the dialog to give it focus.
Is it possible (1) to make the focus go automatically to the
modal dialog if present? (2) to get the focus to the dialog
via the keyboard?
Am 10.10.2025 um 08:07 schrieb Mark Summerfield:
I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
I must then click the dialog to give it focus.
Is it possible (1) to make the focus go automatically to the
modal dialog if present? (2) to get the focus to the dialog
via the keyboard?
grab -global $toplevel
I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
Mark Summerfield <m.n.summerfield@gmail.com> wrote:
I have a Tcl/Tk 9 app with a main window and which sometimes
pops up a modal toplevel window (e.g., a confirmation dialog).
If I then switch to another application altogether, when I
context switch back to my original app, the _main window_ gets
the focus (even though the dialog is still there & even though
I can't interact with the main window).
Sounds like either a window manager bug (switching away to another app
and back are not Tk's responsibility). The window manager should be remembering the dialog was present and had focus at the switch away,
and returning the focus to the dialog when switching back.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,072 |
Nodes: | 10 (0 / 10) |
Uptime: | 129:25:47 |
Calls: | 13,772 |
Files: | 186,986 |
D/L today: |
254 files (119M bytes) |
Messages: | 2,429,796 |