Seite 1 von 1

tkMessageBox.askyesno falscher return value? -> Bug?

Verfasst: Montag 16. Oktober 2006, 11:33
von Mati
Halo

ich habe eine frage.
Im nachfolgenden code (einfach nehmen udn ausführen) wird bei cklick auf 'Yes' der tkMessageBox.askyesno immer false anstatt true zurückgegeben? WARUM? Wenn ich das vorgeschaltete askopenfile auskommentiere gibt die tkMessageBox dann richtig "True" zurück bei click auf "Yes". Ist das ein Bug?
Oder wo liegt mein fehler???

Code: Alles auswählen

from Tkinter import *
import tkMessageBox
from tkFileDialog import *
import os

def start():
        chosen_file = askopenfile(filetypes=[('ODB-files','.odb')],
                                 initialdir=os.path.abspath('.'))

        res = True
        res = tkMessageBox.askyesno('Overwrite content',
                                   'The defined output folder is already existent!\nDo you really want to overwrite' + \
                                 ' the content within this folder?')
        print res

def main():
       root=Tk()
       root.wm_title('ABAQUS Postprocessor')
       root.geometry('+300+300')
       buttonStart=Button(root, text='Start postprocessing...', command=start)
       buttonStart.pack()
       root.mainloop()
main()


Danke

Verfasst: Montag 16. Oktober 2006, 12:13
von HWK
Bei mir funktioniert es normal.
Was soll Zeile 11?
MfG
HWK

Verfasst: Montag 16. Oktober 2006, 12:23
von Mati
zeile 11 soll gar nix :)
kann raus

ich arbeite mit python: Python 2.3.4
und tcl/tk: tk-8.4.7-2

könnte an der tcl/tk version liegen oder?

Verfasst: Montag 16. Oktober 2006, 12:35
von pr0stAta
habe tk version 8.4
und python 2.4 unter win2k.
bei mir läufts

Verfasst: Montag 16. Oktober 2006, 12:42
von Mati
liegt an der python version. dieser bug wurde erst ab 2.3.5 gefixt - ich hab ja im moment 2.3.4 :(