#!/usr/bin/wish

proc _check_state {} {
  set state_enabled [exec r2l p enabled;] 
  .state configure -text $state_enabled
}


button .state -padx 20 -pady 20 -command { exec r2l s toggle; _check_state}
_check_state

frame .dir
button .dir.ltr     -text "<" -command { exec r2l b rtl; _check_state}
button .dir.neutral -text "N" -command { exec r2l b neutral; _check_state }
button .dir.rtl     -text ">" -command { exec r2l b ltr; _check_state}
button .check       -text "check state" -command { _check_state }

pack .dir.ltr -side left
pack .dir.neutral -side left
pack .dir.rtl -side left

pack .state
pack .dir
pack .check 

