I run a unix command using a button that restarts named. I notice that
when I run the button, it indents and then pops out after the named
has restarted. Is there someway to put in some type of spinning wheel
until the command has completed, just so it looks nicer?
Below is the script.
#!/usr/bin/wish
#############################################################################
# Visual Tcl v1.10 Project
#
#################################
# GLOBAL VARIABLES
#
global widget;
#################################
# USER DEFINED PROCEDURES
#
proc init {argc argv} {
}
init $argc $argv
proc main {argc argv} {
}
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 1137 870
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 \
-background #38d9d9 -highlightcolor #0000f2 -relief raised
wm focusmodel $base passive
wm geometry $base 444x446+277+117
wm maxsize $base 1137 870
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm deiconify $base
wm title $base "Chiron Diagnostics System Administration Screen"
frame $base.fra25 \
-borderwidth 2 -height 155 -relief groove -width 410
button $base.fra25.but26 \
-activeforeground #740000 -borderwidth 7 \
-command {exec /usr/sbin/in.named.restart} -padx 11 -pady 4 \
-text {UPDATE DNS & NIS} -width 31
button $base.but29 \
-borderwidth 7 -padx 11 -pady 4 -text {ADD A NEW USER} -width 31
button $base.but30 \
-borderwidth 7 -command {exec xterm -e pico /etc/passwd} -padx 11 \
-pady 4 -text {Edit Passwd File} -width 31
button $base.but17 \
-anchor n -borderwidth 7 -command {exec xterm -e pico
/etc/aliases} \
-padx 11 -pady 4 -text {Edit Aliases} -width 31
label $base.lab18 \
-borderwidth 1 -highlightcolor #0000aa \
-text {Below are the Buttons for Lesser Tasks} -width 36
###################
###################
# SETTING GEOMETRY
###################
pack $base.fra25 \
-in .top17 -anchor center -expand 0 -fill none -side top
pack $base.fra25.but26 \
-in .top17.fra25 -anchor center -expand 0 -fill none -side top
pack $base.but29 \
-in .top17 -anchor center -expand 0 -fill none -side top
pack $base.but30 \
-in .top17 -anchor center -expand 0 -fill none -side top
pack $base.but17 \
-in .top17 -anchor center -expand 0 -fill none -side top
pack $base.lab18 \
-in .top17 -anchor center -expand 0 -fill none -side top
}
Window show .
Window show .top17
main $argc $argv
---------------------------------------------------------------------------
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).