set slideadd .slide_add_output

proc slide_add_output {} {

   global slideadd

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

   global env
   set env(DISPLAY) :0
   toplevel $slideadd -width 10c -height 5c
   wm title $slideadd "Slidebar Output"

   label $slideadd.title -text "Adding Output"  -relief groove -fg blue
   pack $slideadd.title -side top  -fill x -padx 3 -pady 3


   menubutton $slideadd.gesdac -text GESDAC -menu $slideadd.gesdac.menu


	
	
	
   #--------------------------------------------------------		
   # Create the Analog submenu
   #--------------------------------------------------------

   # Create the "GESDAC" submenu
   menu $slideadd.gesdac.menu
   $slideadd.gesdac.menu add cascade -label "1-8" \
	-menu $slideadd.gesdac.menu.b1
   $slideadd.gesdac.menu add cascade -label "9-16" \
	-menu $slideadd.gesdac.menu.b2
   $slideadd.gesdac.menu add cascade -label "17-24" \
	-menu $slideadd.gesdac.menu.b3
   $slideadd.gesdac.menu add cascade -label "25-32" \
	-menu $slideadd.gesdac.menu.b4

   # adding element to the "GESDAC"	

   menu $slideadd.gesdac.menu.b1
   $slideadd.gesdac.menu.b1 add command -label "1 [get_slidebar_name 2 1]" \
	-command {slide_list_output "Ana Gesdac 1"}
   $slideadd.gesdac.menu.b1 add command -label "2 [get_slidebar_name 2 2]" \
	-command {slide_list_output "Ana Gesdac 2"}
   $slideadd.gesdac.menu.b1 add command -label "3 [get_slidebar_name 2 3]" \
	-command {slide_list_output "Ana Gesdac 3"}
   $slideadd.gesdac.menu.b1 add command -label "4 [get_slidebar_name 2 4]" \
	-command {slide_list_output "Ana Gesdac 4"}
   $slideadd.gesdac.menu.b1 add command -label "5 [get_slidebar_name 2 5]" \
	-command {slide_list_output "Ana Gesdac 5"}
   $slideadd.gesdac.menu.b1 add command -label "6 [get_slidebar_name 2 6]" \
	-command {slide_list_output "Ana Gesdac 6"}
   $slideadd.gesdac.menu.b1 add command -label "7 [get_slidebar_name 2 7]" \
	-command {slide_list_output "Ana Gesdac 7"}
   $slideadd.gesdac.menu.b1 add command -label "8 [get_slidebar_name 2 8]" \
	-command {slide_list_output "Ana Gesdac 8"}


   menu $slideadd.gesdac.menu.b2
   $slideadd.gesdac.menu.b2 add command -label "9 [get_slidebar_name 2 9]" \
	-command {slide_list_output "Ana Gesdac 9"}
   $slideadd.gesdac.menu.b2 add command -label "10 [get_slidebar_name 2 10]" \
	-command {slide_list_output "Ana Gesdac 10"}
   $slideadd.gesdac.menu.b2 add command -label "11 [get_slidebar_name 2 11]" \
	-command {slide_list_output "Ana Gesdac 11"}
   $slideadd.gesdac.menu.b2 add command -label "12 [get_slidebar_name 2 12]" \
	-command {slide_list_output "Ana Gesdac 12"}
   $slideadd.gesdac.menu.b2 add command -label "13 [get_slidebar_name 2 13]" \
	-command {slide_list_output "Ana Gesdac 13"}
   $slideadd.gesdac.menu.b2 add command -label "14 [get_slidebar_name 2 14]" \
	-command {slide_list_output "Ana Gesdac 14"}
   $slideadd.gesdac.menu.b2 add command -label "15 [get_slidebar_name 2 15]" \
	-command {slide_list_output "Ana Gesdac 15"}
   $slideadd.gesdac.menu.b2 add command -label "16 [get_slidebar_name 2 16]" \
	-command {slide_list_output "Ana Gesdac 16"}


   menu $slideadd.gesdac.menu.b3
   $slideadd.gesdac.menu.b3 add command -label "17 [get_slidebar_name 2 17]" \
	-command {slide_list_output "Ana Gesdac 17"}
   $slideadd.gesdac.menu.b3 add command -label "18 [get_slidebar_name 2 18]" \
	-command {slide_list_output "Ana Gesdac 18"}
   $slideadd.gesdac.menu.b3 add command -label "19 [get_slidebar_name 2 19]" \
	-command {slide_list_output "Ana Gesdac 19"}
   $slideadd.gesdac.menu.b3 add command -label "20 [get_slidebar_name 2 20]" \
	-command {slide_list_output "Ana Gesdac 20"}
   $slideadd.gesdac.menu.b3 add command -label "21 [get_slidebar_name 2 21]" \
	-command {slide_list_output "Ana Gesdac 21"}
   $slideadd.gesdac.menu.b3 add command -label "22 [get_slidebar_name 2 22]" \
	-command {slide_list_output "Ana Gesdac 22"}
   $slideadd.gesdac.menu.b3 add command -label "23 [get_slidebar_name 2 23]" \
	-command {slide_list_output "Ana Gesdac 23"}
   $slideadd.gesdac.menu.b3 add command -label "24 [get_slidebar_name 2 24]" \
	-command {slide_list_output "Ana Gesdac 24"}


   menu $slideadd.gesdac.menu.b4
   $slideadd.gesdac.menu.b4 add command -label "25 [get_slidebar_name 2 25]" \
	-command {slide_list_output "Ana Gesdac 25"}
   $slideadd.gesdac.menu.b4 add command -label "26 [get_slidebar_name 2 26]" \
	-command {slide_list_output "Ana Gesdac 26"}
   $slideadd.gesdac.menu.b4 add command -label "27 [get_slidebar_name 2 27]" \
	-command {slide_list_output "Ana Gesdac 27"}
   $slideadd.gesdac.menu.b4 add command -label "28 [get_slidebar_name 2 28]" \
	-command {slide_list_output "Ana Gesdac 28"}   	
   $slideadd.gesdac.menu.b4 add command -label "29 [get_slidebar_name 2 29]" \
	-command {slide_list_output "Ana Gesdac 29"}
   $slideadd.gesdac.menu.b4 add command -label "30 [get_slidebar_name 2 30]" \
	-command {slide_list_output "Ana Gesdac 30"}
   $slideadd.gesdac.menu.b4 add command -label "31 [get_slidebar_name 2 31]" \
	-command {slide_list_output "Ana Gesdac 31"}
   $slideadd.gesdac.menu.b4 add command -label "32 [get_slidebar_name 2 32]" \
	-command {slide_list_output "Ana Gesdac 32"}
	
	
	
	
   # add a Close button
   button $slideadd.close -text Close -command {destroy .slide_add_output}

   #---------------------------------------------
   # Pack things up
   #---------------------------------------------

   pack $slideadd.gesdac -side top	
   pack $slideadd.close -side bottom -pady 3m

   proc slide_list_output { out } {

      global slideadd slide_name slide_conn slidex slidey	
   	
      set board 2
      set elem_num [lindex $out 2]

      # Slidebar Name
      set slide_name [get_slidebar_name $board $elem_num]

      # Slidebar connection
      set slide_conn $out

      # Button Position on Screen 1
      set pos [get_slidebar_pos $elem_num 1]
      set slidex [lindex $pos 0]
      set slidey [lindex $pos 1]


      destroy $slideadd

   # end proc slide_list_output
   }


# end  of procedure slide_add_output   	
}



