in reply to Re^2: Perl/Tk and Transparent Canvases
in thread Perl/Tk and Transparent Canvases

Um, if you're talking about your transparent canvas (or your popup menu) being its own separate app, distinct from other apps (or the user's "desktop") that make up the things that are always visible, then you might run into some issues with input focus.

I'm a little rusty on the details for X (and I have only limited knowledge of MS-windows), but as a rule, any user input event (mouse click or keystroke) is normally available to only one app: the one that currently holds input focus, which is typically one whose window is on top. So if your "plate glass" interface is always on top, it might be tough to allow the user to interact directly with anything underneath it. (Or perhaps that is your intention?)

If your "always-visible" background and your "usually invisible" control widgets are all part of the same Tk app, then I believe there is a way to handle the input events such that widgets at lower layers get a chance to see them (but I've never tried that, so I'm not sure).

Replies are listed 'Best First'.
Re^4: Perl/Tk and Transparent Canvases
by Mikster (Acolyte) on Aug 03, 2005 at 06:06 UTC
    What I have in mind is a small canvas (with transparent background and now window decoration) that pops up under the cursor when a mouse button is pressed, and upon which canvas items like circles, polygons, etc. are drawn to act as control elements. I know I can do everything I need to do to make this work except put up a mainwindow whose background has a stipple of "transparent", and containing a canvas which also has a transparent background.

    That's the key element I can't seem to figure out how to do (and suspect can't be done without me doing something drastic like writing my own version of a canvas and/or mainwindow).

    If I can't do it, I'll have to settle for the less aesthetically pleasing (and content occluding) grey background.