source /home/ventana/source/elem_prop2.tcl

#--------------------------------------------------
# initialize and set variable for the window name
#--------------------------------------------------
set digin2 .digital_input_list2




##############################################################
# "dispay" is the path of the entry window where we want
# to display our selection
##############################################################


proc digital_input_list2 { display } {

   #-------------------
   # Declare variable
   #-------------------
   global outd
   global digin2


   if [winfo exists $digin2] { destroy $digin2 }

   #-------------------------------------------------------
   # Create a new window that contains the digital list
   #-------------------------------------------------------
   global env
   set env(DISPLAY) :0.1
   toplevel $digin2
   set outd $display


   button $digin2.in1 -relief flat -text "Digital Input #1" -command { digin_selected $outd  "Digital Input 1"}
   button $digin2.in2 -relief flat -text "Digital Input #2" -command { digin_selected $outd  "Digital Input 2"}
   button $digin2.in3 -relief flat -text "Digital Input #3" -command { digin_selected $outd  "Digital Input 3"}
   button $digin2.in4 -relief flat -text "Digital Input #4" -command { digin_selected $outd  "Digital Input 4"}
   button $digin2.in5 -relief flat -text "Digital Input #5" -command { digin_selected $outd  "Digital Input 5"}
   button $digin2.in6 -relief flat -text "Digital Input #6" -command { digin_selected $outd  "Digital Input 6"}
   button $digin2.in7 -relief flat -text "Digital Input #7" -command { digin_selected $outd  "Digital Input 7"}
   button $digin2.in8 -relief flat -text "Digital Input #8" -command { digin_selected $outd  "Digital Input 8"}
   button $digin2.in9 -relief flat -text "Digital Input #9" -command { digin_selected $outd  "Digital Input 9"}
   button $digin2.in10 -relief flat -text "Digital Input #10" -command { digin_selected $outd  "Digital Input 10"}

   for {set i 1 } {$i <= 10 } {incr i} {

   	pack $digin2.in$i -side top


   }

  button $digin2.b -text Close -command {destroy $digin2}
  pack $digin2.b






   proc digin_selected { display text } {

      global digin2

      $display configure -state normal
      $display delete 0 100
      $display insert 0 $text
      $display configure -state disabled

      popup2 1 1 [lindex $text 2]

      # Close the output list after
      destroy $digin2

   # end proc list_output
   }

#end of proc "digital_input_list2"
}