tags:

views:

38

answers:

1

I'm writing a little program that basically has a bunch of buttons that when you click one, it inputs a certain line of text into an online game I play. It would be a lot easier to use if the GUI would stay on top of the active game window so the user could be playing and then press a button on the panel without having to bring it to the front first.

Any help on how to do this would be great. Thanks

EDIT: Using tkinter

+1  A: 

You will need to provide the information on which GUI framework you are using for detailed answer at SO.

On windows you could do something like this with the handle of your window.

import win32gui
win32gui.SetWindowPos(hWnd, win32con.HWND_TOPMOST, 0,0,0,0,
win32con.SWP_NOMOVE | win32con.SWP_NOSIZE)

Also with Tkinter, you might want to try. I have not tried it though.

root = Tk()
root.wm_attributes("-topmost", 1)
pyfunc
root.wm_attributes("-topmost", 1)is exactly what I needed. Thanks!
Matt