Tk Library Source Code

Artifact [52987f65a6]
Login

Artifact 52987f65a6cf71d33a13b58a008318b08e6d4c66330c68ae7ca50aded3270225:

Attachment "dateentry.patch" to ticket [2bcb3b11e7] added by ralfixx 2021-11-17 17:56:18. (unpublished)
--- tklib/modules/widget/dateentry.tcl~
+++ tklib/modules/widget/dateentry.tcl 
@@ -131,7 +131,6 @@
     component dropbox
     component calendar
 
-    variable waitVar
     variable formattedDate
     variable rawDate
     variable startOnMonday 1
@@ -205,9 +204,11 @@
     }
 
     method post { args } {
+	if {"disabled" in [$self state]} {
+	    return
+	}
 	# XXX should we reset date on each display?
 	if {![winfo exists $dropbox]} { $self MakeCalendar }
-	set waitVar 0
 
 	foreach {x y} [$self PostPosition] { break }
 	wm geometry $dropbox "+$x+$y"
@@ -219,10 +220,6 @@
 	}
 	focus -force $calendar
 	return
-
-	tkwait variable [myvar waitVar]
-
-	$self unpost
     }
 
     method unpost {args} {
@@ -274,11 +271,10 @@
     method DateChosen { args } {
 	upvar 0 $options(-textvariable) date
 
-        set waitVar 1
 	set date $formattedDate
 	set rawDate [clock scan $formattedDate -format $options(-dateformat)]
 	if { $options(-command) ne "" } {
-	    uplevel \#0 $options(-command) $formattedDate $rawDate
+	    uplevel \#0 $options(-command) [list $formattedDate] [list $rawDate]
 	}
         $self unpost