einige Konstanten nicht verfügbar

Fragen zu Tkinter.
Antworten
Papp Nase
User
Beiträge: 139
Registriert: Dienstag 11. März 2014, 15:12

Hallo,

ich lerne grade das tkinter.Entry kennen und benutze dazu diese Internetseite:

http://effbot.org/tkinterbook/entry.htm
validate=
Specifies when validation should be done. You can use “focus” to validate whenever the widget gets or loses the focus, “focusin” to validate only when it gets focus, “focusout” to validate when it loses focus, “key” on any modification, and ALL for all situations. Default is NONE (no validation). (validate/Validate)
validatecommand=
A function or method to call to check if the contents is valid. The function should return a true value if the new contents is valid, or false if it isn’t. Note that this option is only used if the validate option is not NONE. (validateCommand/ValidateCommand)
Ich kann Entry verschiedene optionale Argumente übergeben, u.a. validate = {focus, focusout, key, NONE, ALL}.

Gebe ich ein: validate=focus, dann kennt der Interpreter focus nicht - in dem Modul tkinter ist focus nicht definiert, genauso nicht focusout und key, es gibt dort nur NONE und ALL.

Warum kann ich validate=focus nicht benutzen?
EyDu
User
Beiträge: 4881
Registriert: Donnerstag 20. Juli 2006, 23:06
Wohnort: Berlin

Vielleicht gibt es ja einen Grund warum die Parameter in Anführungszeichen geschrieben sind ;-)
Das Leben ist wie ein Tennisball.
Papp Nase
User
Beiträge: 139
Registriert: Dienstag 11. März 2014, 15:12

danke für den Tipp - ja sorry, es ist montag morgen :-)
BlackJack

Und als Konstanten gibt es die wahrscheinlich nicht weil die spezielle Unterstützung für `validate`/`validatecommand` in der Tk-Anbindung eher unterirdisch ist.
Antworten