unexplained behavior of tkMessageBox.askyesno

Peter Kleiweg in.aqua.scribis at nl.invalid
Tue Sep 7 15:31:54 EDT 2004


I have a program with these fragments:



from Tkinter import *
import tkFileDialog
import tkMessageBox

def openProject():
    filepath = tkFileDialog.askopenfilename(filetypes=(("project files","*.ini"), ("all","*")))
    if filepath:
        loadProject(filepath)

def makeClean():
    if tkMessageBox.askyesno('Make clean', 'Remove all files created by Make?'):
        print 'yes'
        # more code



If I call makeClean(), I get the yes/no box. If I click 'yes',
it prints 'yes', unless I have called openProject() sometimes
earlier. In the latter case, none of the code following the
askyesno gets executed, whether I click 'yes' or 'no'. It also
happens when I have called openProject() earlier and clicked
'Cancel'.

This error happens on one Linux machine ([GCC 3.3.1 (SuSE
Linux)] on linux2), but not on another ([GCC 2.95.3 20010315
(SuSE)] on linux2). Both have Python 2.3.4. It works fine on
Windows98 with Python 2.4

Anyone any idea what is going on?


-- 
Peter Kleiweg  L:NL,af,da,de,en,ia,nds,no,sv,(fr,it)  S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html




More information about the Python-list mailing list