Tkinter: Strange Pmw behaviour

Janos Blazi jblazi at hotmail.com
Mon Sep 24 21:24:28 CEST 2001


Let us consider the following code:

def get_rp(root,rp,event):
    z=Pmw.CounterDialog(root,label_text='Maximale Rohpunktzahl (10-100):',
   counter_labelpos='w',entryfield_value=`rp`,
   counter_datatype='numeric',
   entryfield_validate={'validator':'numeric','min':2,'max':100},
   buttons=('OK','Abbrechen'),defaultbutton='OK',
   title='xxxxxxxxxxxxxxxxxxxxxxxxxx')


z.component('counter').component('entryfield').component('entry').configure(
 width=3)
    z.tkraise()

    for i in range(10000):
        for j in range(1000):
            a=1

    result=z.activate()
    if result=='OK': return z.get()
    else: return None

The two nested for-loops that do nothing delay the program for a decisive
second. Now I see that after the tkraise command is executed, the counter
dialog window first pops up at a different place and without the delay loops
I saw that a window popped up but could not see which window it was. So I
built in the loops and now I can see the culprit: it is my very counter
dialog window that first pops up at the wrong place!

*It is disturbing!*

Is this normal? Can I help it?

J.B.




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----



More information about the Python-list mailing list