Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter Window On Top

Reply
Thread Tools

Tkinter Window On Top

 
 
Trevor
Guest
Posts: n/a
 
      05-15-2009
Can a Tkinter application create a COM object and keep its own window
on top of it?

excel = win32com.client.Dispatch('Excel.Application')

I would like the user to be able to see and interact with the Excel
application but keep the Tkinter application on top.
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      05-16-2009
En Fri, 15 May 2009 16:39:41 -0300, Trevor <>
escribió:

> Can a Tkinter application create a COM object and keep its own window
> on top of it?
>
> excel = win32com.client.Dispatch('Excel.Application')
>
> I would like the user to be able to see and interact with the Excel
> application but keep the Tkinter application on top.


I don't know how to do that directly with tk, but I'd use the SetWindowPos
function: http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx
The tricky part is to get the right hwnd, this seems to work:

>>> root = Tkinter.Tk()
>>> hwnd = int(root.wm_frame(),0)
>>> win32gui.SetWindowPos(hwnd,

.... win32con.HWND_TOPMOST,
.... 0,0,0,0,
.... win32con.SWP_NOMOVE | win32con.SWP_NOSIZE)

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tkinter - Force toplevel window to stay on top of Tk() window rahulnag22@yahoo.com Python 1 06-08-2007 05:50 PM
Open a new window on top of parent window using script Ralf ASP .Net 2 11-15-2006 09:45 PM
opening new window in one window using Tkinter -- Help please Clara Python 6 04-25-2005 03:09 AM
make a browser window stay on top window handle? =?Utf-8?B?RHVzdGluIElJLg==?= ASP .Net 1 08-18-2004 06:26 AM
window.opener.top.location.top.close ??? find clausen Javascript 2 10-05-2003 04:35 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57