[python-users] Bug in Tkinter?
Patrick Holz
patrick.holz at uni-koeln.de
Mi Feb 24 11:04:13 CET 2010
Hi,
danke für Eure Infos, ich habe mal einen Bugreport erstellt und bin
gespannt auf die Lösung.
MfG, Patrick Holz
--
Dipl.-Wirt.-Inf. Patrick Holz University of Cologne
Mail: patrick.holz at uni-koeln.de Rechenzentrum (RRZK)
Tel.: 49-(0)221-478-7002 Robert-Koch-Str. 10
URL: http://www.uni-koeln.de/~a0646 D-50931 Cologne (Germany)
Thomas Lenarz schrieb:
> Christopher Arndt schrieb:
>> Am 19.02.2010 13:47, schrieb Patrick Holz:
>>> Habe nach einem Bugreport gegooglet, aber nichts gefunden. Daher die
>>> Frage: Könnte jemand das mal verifizieren, bevor ich einen Bugreport
>>> aufmache?
>> Schon mal in die Tkinter oder tk Sourcen geschaut um das Problem näher
>> einzugrenzen?
> Hallo Patrick,
> ich hätte auch nur Vorschläge zur Vorgehensweise (kann leider selbst
> nicht testen, da kein Windows 7 verfügbar).
>
> -aus Python heraus einmal askopenfilenames() statt askopenfiles()
> ausprobieren -> Problem gleich?
> -Den File-Dialog einmal direkt unter TCL/TK ausprobieren.
> -Die relevanten Sourcen anschauen und ggf. debuggen:
>
> --Python: tkFileDialog.py
> --TK: tkWinDialog.c Hier wird die Windows API-Funktion
> GetOpenFileNameW() mit dem Flag OFN_ALLOWMULTISELECT genutzt.
>
> Der interessante Teil folgt nach dem Aufruf von GetOpenFileNameW():
>
> if (winCode != 0) {
> if (ofn.Flags & OFN_ALLOWMULTISELECT) {
> /*
> * The result in custData->szFile contains many items, separated
> * with null characters. It is terminated with two nulls in a row.
> * The first element is the directory path.
> */
>
> WCHAR *files;
> Tcl_DString dirBuf;
> [...]
>
> Also, Windows liefert offenbar eine durch 0-Bytes separierte Liste von
> Dateinamen zurück, die insgesamt durch zwei aufeinanderfolgende 0-Bytes
> abgeschlossen wird.
>
> Möglicherweise hat Microsoft in Windows7 das Rückgabeformat verändert?
>
> Unter http://msdn.microsoft.com/en-us/library/ms646927(VS.85).aspx habe
> ich die Beschreibung der API-Funktion GetOpenFileName() gefunden. (Hoffe
> der Link funktioniert.)
>
> Unter der Beschreibung des Flags OFN_ALLOWMULTISELECT findet man eine
> Beschreibung der Rückgabestruktur von mehreren Dateinamen. Hier scheint
> es tatsächlich auch unterschiedliche Varianten zu geben:
>
> --
> OFN_ALLOWMULTISELECT
> Specifies that the File Name list box allows multiple selections.
> If you also set the OFN_EXPLORER flag, the dialog box uses the
> Explorer-style user interface; otherwise, it uses the old-style user
> interface.
>
> If the user selects more than one file, the lpstrFile buffer
> returns the path to the current directory followed by the file names of
> the selected files. The nFileOffset member is the offset, in bytes or
> characters, to the first file name, and the nFileExtension member is not
> used. For Explorer-style dialog boxes, the directory and file name
> strings are NULL separated, with an extra NULL character after the last
> file name. This format enables the Explorer-style dialog boxes to return
> long file names that include spaces. For old-style dialog boxes, the
> directory and file name strings are separated by spaces and the function
> uses short file names for file names with spaces. You can use the
> FindFirstFile function to convert between long and short file names.
>
> If you specify a custom template for an old-style dialog box, the
> definition of the File Name list box must contain the LBS_EXTENDEDSEL value.
> --
>
> Hoffe die Infos können irgendwie helfen....
>
> Viel Erfolg bei der Suche...
>
> Viele Grüße
> Thomas
> ________________________________________
> Diese Mail erhalten Sie ueber die Mailingliste Python-users der Universitaet zu Koeln
> Python-users at uni-koeln.de
> https://lists.uni-koeln.de/mailman/listinfo/python-users
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : smime.p7s
Dateityp : application/x-pkcs7-signature
Dateigröße : 6000 bytes
Beschreibung: S/MIME Cryptographic Signature
URL : <http://lists.uni-koeln.de/pipermail/python-users/attachments/20100224/67ae1875/attachment.bin>
Mehr Informationen über die Mailingliste python-users