views:

167

answers:

1

I want my window to be invisible most of the time, but get to top of the screen on hotkey and hide again if the user switches to another application.

In my hotkey handler I use

self.Show() 
self.Raise() 
self.Iconize(False)

and in my activate message handler

self.Hide() 
self.Iconize(True)

but the window pops up on top of the screen, but remains deactivated: it's title bar colour is a inactive one, and it flashes in the taskbar as a window requiring my attention and it doesn't get EVT_ACTIVATE. I tried to add self.SetFocus, but no effect.

And if I use

self.Show()  
self.SetFocus()

in hotkey handler and in my activate message handler

self.Hide()

and it works okay if I deactivate my window by clicking to another window, but if I press Alt-Tab and then invoke my window with a hotkey it doesn't appear on top of the screen but just flashes in the taskbar. Also I made an ability to hide it by pressing a button on it, and if I hide it this way, it also doesn't show correctly afterwards as in the case with Alt-Tab

A: 

you have to use a window manager to activate windows. I'm using wmctrl for that purpose (cannot find the same func. through kwin's dbus for kde).

volty