# Petite calculatrice très basique:

# zone de saisie de la commande:
entry .comand -textvariable comande -width 40 -state normal -bg white -justify center

button .enter -text "Enter" -command calculExpr

# Affichage du résultat:
label .result -textvariable res -width 40

pack .comand .result .enter -side top

bind . <Escape> exit
bind . <Return> calculExpr
focus -force .comand

proc calculExpr {} {
  global comande res
  if { [ catch {set res [expr $comande]} fid ] } {
    set lg [string length $fid]
    set res "Synthax error"
    
    #  tk_messageBox -icon error -message "$fid " -title "ERREUR" -parent . -type ok
    

  }
    
}