Tk Library Source Code

Artifact [cd79bb90da]
Login

Artifact cd79bb90da3ebbbaa383ccbce6b771bf1cb12c3a489ca141c55631f6df47f1ee:

Attachment "diff" to ticket [fcce9df1f4] added by ralfixx 2023-04-17 15:22:07. (unpublished)
diff -u tklib/widget/dateentry.tcl.aegis tklib/widget/dateentry.tcl
--- tklib/widget/dateentry.tcl.aegis	2023-03-31 13:06:27.000000000 +0200
+++ tklib/widget/dateentry.tcl	2023-04-17 16:56:40.177981895 +0200
@@ -151,10 +151,7 @@
 	set rawDate [clock scan "$x 00:00:00" -format "%d/%m%/%Y %H:%M:%S"]
 	set formattedDate [clock format $rawDate -format $options(-dateformat)]
 
-	$hull configure -state normal
-	$hull delete 0 end
-	$hull insert end $formattedDate
-	$hull configure -state readonly
+	$self set_date $formattedDate
     }
 
     method C-passtocalendar {option value} {
@@ -278,6 +275,18 @@
 	}
         $self unpost
 
+	$self set_date $formattedDate
+    }
+
+    
+    #
+    #  set_date --
+    #
+    #  update the date entry and set internal variable so the calendar gets the new date, too.
+    #
+    ##
+    method set_date {date} {
+	set formattedDate $date
 	$hull configure -state normal
 	$hull delete 0 end
 	$hull insert end $formattedDate

Diff finished.  Mon Apr 17 17:21:01 2023