saitology9 <
[email protected]> wrote:
Hello,
I don't have code to reproduce the things I mention below but all of
this runs fine on MS Windows. I suppose I can add workarounds for each
but I wonder if there is a simple answer behind all this. The Linux is Debian 11.5 64 bit running inside a vm. Tcl version is 8.6.12, 64 bit.
I have a script that creates a window with a menubar and a canvas. The menubar has a File sub-menu for selecting/deleting/copying files.
1) When I click on an item under File and make a selection, the menu
does not disappear. Instead, it stays on. Even after I move the window
to which it is connected, the menu stays where it was displayed. The "-tearoff" option is off and set to zero. The action assigned to the
menu item starts running and popping up its own dialogs, etc. But the
menu lingers on.
Unable to recreate on Linux, even with code that intentionally blocks
the event loop:
menu .mb
menu .file
.file add command -label Open -command {after 10000}
.mb add cascade -menu .file -label File
. configure -menu .mb
The menu disappears, then the UI freezes for 10 seconds (before all of
the original menubar border is redrawn). After 10 seconds, all
returns to normal.
2) I create a toplevel with "wm overrideredirect". This new window does
not respond to Events such as FocusIn/FocusOut/Enter/Leave/etc.
Expected under X11. overrideredirect windows are ignored by the window manager, and it is the window manager that controls focus and
enter/leave events for windows on X11. This is mentioned in the Tk
docs (the 'ignore' part, the docs presume knowledge of what functions
the window manager performs on X11):
man wm:
wm overrideredirect window ?boolean?
... Setting the override-redirect flag for a window causes it to
be ignored by the window manager; among other things, this
means that the window will not be reparented from the root
window into a decorative frame and the user will not be able to
manipulate the window using the normal window manager
mechanisms. ...
3) The window I created in step 2 above does a tk_popup menu.
Windows themselves don't do anything. The tcl code that creates the overrideredirect window also runs tk_popup.
This does not show up. Perhaps it is hidden under the window and it
is invisible. I am not sure.
Did you also create a menu to 'pop up' -- or are you 'poping up' the
menu from #1 that looks to be stuck? Which might be why the #1 menu
appears to 'get stuck'.
Are you doing anything else that might block the event loop?
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)