On Wed, 21 Jan 1998, J. J. Westergren wrote:

> What's the code you are using to assign the variable to the
> other variable?

I assume that you have some button that executes a command which changes
the text of the label? Such a command could be:

proc JustDoIt {} {
    global entry_var label_var
    set label_var $entry_var
}

So, here's an example app from vTcl:

#!/usr/bin/wish
#############################################################################
# Visual Tcl v1.11 Project
#

#################################
# GLOBAL VARIABLES
#
global widget; 

#################################
# USER DEFINED PROCEDURES
#
proc init {argc argv} {

}

init $argc $argv


proc {main} {argc argv} {

}

proc {JustDoIt} {} {
global entry_var label_var
    set label_var $entry_var
}

proc {Window} {args} {
global vTcl
    set cmd [lindex $args 0]
    set name [lindex $args 1]
    set newname [lindex $args 2]
    set rest [lrange $args 3 end]
    if {$name == "" || $cmd == ""} {return}
    if {$newname == ""} {
        set newname $name
    }
    set exists [winfo exists $newname]
    switch $cmd {
        show {
            if {$exists == "1" && $name != "."} {wm deiconify $name;
return}
            if {[info procs vTclWindow(pre)$name] != ""} {
                eval "vTclWindow(pre)$name $newname $rest"
            }
            if {[info procs vTclWindow$name] != ""} {
                eval "vTclWindow$name $newname $rest"
            }
            if {[info procs vTclWindow(post)$name] != ""} {
                eval "vTclWindow(post)$name $newname $rest"
            }
        }
        hide    { if $exists {wm withdraw $newname; return} }
        iconify { if $exists {wm iconify $newname; return} }
        destroy { if $exists {destroy $newname; return} }
    }
}

#################################
# VTCL GENERATED GUI PROCEDURES
#

proc vTclWindow. {base} {
    if {$base == ""} {
        set base .
    }
    ###################
    # CREATING WIDGETS
    ###################
    wm focusmodel $base passive
    wm geometry $base 1x1+0+0
    wm maxsize $base 1009 738
    wm minsize $base 1 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm withdraw $base
    wm title $base "vt.tcl"
    ###################
    # SETTING GEOMETRY
    ###################
}

proc vTclWindow.top17 {base} {
    if {$base == ""} {
        set base .top17
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    ###################
    # CREATING WIDGETS
    ###################
    toplevel $base -class Toplevel
    wm focusmodel $base passive
    wm geometry $base 186x74+60+140
    wm maxsize $base 1009 738
    wm minsize $base 1 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm deiconify $base
    wm title $base "New Toplevel 1"
    label $base.lab18 \
        -background gray85 -borderwidth 1 -relief raised \
        -textvariable label_var 
    entry $base.ent19 \
        -highlightthickness 0 -textvariable entry_var 
    button $base.but20 \
        -command JustDoIt -highlightthickness 0 -padx 9 -pady 3 \
        -text {Just Do It} 
    ###################
    # SETTING GEOMETRY
    ###################
    pack $base.lab18 \
        -in .top17 -anchor center -expand 0 -fill none -side top 
    pack $base.ent19 \
        -in .top17 -anchor center -expand 0 -fill none -side top 
    pack $base.but20 \
        -in .top17 -anchor center -expand 0 -fill none -side top 
}

Window show .
Window show .top17

main $argc $argv

...RickM...

---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to