Eric Brunel wrote:
On Tue, 27 Mar 2007 12:05:07 +0200, Gigs_ wrote:

Hi all

I cant figure out how to disable resizing of my popup window?
myPopupWindow.wm_resizable(0, 0)

It may or may not make resize controls disappear depending on your
platform and/or window manager. But the resizing will be impossible in
any case.
How to put this popup window to show in the middle of my text editor?
It is writen with Toplevel.
A bit trickier. For example (untested):



def centerPopupWindow():
x, y = editorWindow.winfo_rootx(), editorWindow.winfo_rooty()
w, h = editorWindow.winfo_width(), editorWindow.winfo_height()
ww, hh = myPopupWindow.winfo_width(), myPopupWindow.winfo_height()
myPopupWindow.geometry('%sx%s+%s+%s', ww, hh, x + w/2 - ww/2, y + h/2
- hh/2)

The after_idle trick is needed since the dimensions for the popup window
will only be known when the window is actually displayed. In theory,
myPopupWindow.update_idletasks() should update the display so that the
window dimensions are known, but there are cases where it doesn't work.
So the after_idle trick is surer.

--python -c "print ''.join([chr(154 - ord(c)) for c in
thanks for both replay, they are very helpful. specially this one, it
will took some times for me to figure this. i was completely forgot that
this can be done like that


Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
grouppython-list @
postedMar 27, '07 at 10:05a
activeMar 27, '07 at 1:20p

2 users in discussion

Gigs_: 2 posts Eric Brunel: 1 post



site design / logo © 2022 Grokbase