Problem With Variables Please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
Author Message
 Problem With Variables Please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

hi . I' m greek so sorry for my bad english. I've written a program in
tcl and i have a problem about setting entyfields values of each page
to variables and then print them to the screen. So here is the code:

#!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \

###################################
# set the main window
###################################
set w .button
catch {destroy $w}
toplevel $w
wm title $w "Gui"
wm iconname $w "main"

###################################
# set the iwidget
###################################
package require Iwidgets 4.0

option add *textBackground seashell
option add *Tabnotebook.backdrop DimGray
option add *Scale.width 8
. configure -background white

iwidgets::tabnotebook $w.tnb -width 8i -height 1.4i
pack $w.tnb -padx 4 -pady 4

###################################
# make and display frames objects
#+ validation
###################################
for {set i 1} {$i <= 31} {incr i} {
    set page [$w.tnb add -label "$i"]

    label $page.numb -text "Current Page $i"
    pack $page.numb -side bottom

    iwidgets::entryfield $page.da -labeltext "Destination \nAddress:"
-labelpos nw -width 12 -command {set da [$page.$da get]}
    pack $page.da -side left -padx 1
    iwidgets::entryfield $page.sa -labeltext "Sourse \nAddress:"
-labelpos nw -width 12 -command {set sa($i) [.$sa get]}
    pack $page.sa -side left -padx 1
    iwidgets::entryfield $page.len -labeltext "Packet \nLength:"
-labelpos nw -width 2 -command {set len($i) [.$len get]}
    pack $page.len -side left -padx 35

    iwidgets::radiobox $page.rb -labeltext "Packet data:"
    $page.rb add increm -text "Incremental" -command {$page.fixed
configure -state disabled}
    $page.rb add rand -text "Random" -command {$page.fixed configure
-state disabled}
    $page.rb add fixed -text "Fixed" -command {$page.fixed configure
-state normal}
    pack $page.rb -side left -padx 5

    iwidgets::entryfield $page.fixed -labeltext "Fixed:" -labelpos nw
-width 4 -command {set fixed($i) [.$fixed get]}
    pack $page.fixed -side left
    iwidgets::entryfield $page.clk -labeltext "Time:" -labelpos nw
-width 3 -command {set clk($i) [.$clk get]}
    pack $page.clk -side left -padx 10

    scale $page.rate -label Rate -length 180 -bigincrement 0.0 -from
0.0 -orient horizontal -resolution 1.0 \
            -tickinterval 0.0 -to 100.0 -width 20 -variable rate
    pack $page.rate -side left -padx 20

        iwidgets::buttonbox $page.bb -orient horizontal
        $page.bb add OK -text Run -command {
                        puts stdout "value da is : $da\
                        value i is: $i\
                        value sa is : $sa \
                        value length is : $len \
                        value time is : $clk \
                        value rate is : $rate"}
        $page.bb add Cancel -text Cancel -command {destroy $w}
        $page.bb default OK
        pack $page.bb -expand yes -fill both -side right

Quote:
}

I want to print each variables of all pages to the screen so please
help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thanks A lot.



Sat, 12 Apr 2008 18:53:55 GMT  
 Problem With Variables Please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Do you need something like this? Prints all global variables, scalars
and arrays, to stdout:

proc print_all_vars {} {
   foreach name [lsort [info globals]] {
       upvar #0 $name var
       if [array exists var] {
           parray ::$name
       } else {puts "$name = $var"}
   }

Quote:
}



Sat, 12 Apr 2008 19:06:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ***HELP***HELP***HELP***Please.

2. HELP !..PLEASE,PLEASe,PLEAse,PLEase,PLease,Please,please.....

3. VSE 3.1 Repository Problem: Please help (please please?)

4. ----------------------------------------------------*Question*-------------------------------------------------------------------------

5. Newbie please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

6. Help please: various positioninterpolator-type-things

7. Please Help....................COBOL/400

8. ActivePerl/Python: Problems accessing variables via IActiveScript::GetScriptDispatch

9. Problems..................................................................................

10. please, please, please, please, help

 

 
Powered by phpBB® Forum Software