83 lines
1.9 KiB
PSL
83 lines
1.9 KiB
PSL
## GAGclearlog.proc
|
|
## (GAG procedure)
|
|
## clear the whole or marked part of GEANT4 log in.log.text
|
|
##
|
|
## k.ohtubo(Tubocky)
|
|
##
|
|
## 1997.11.10
|
|
## Tcl/Tk version 8.0
|
|
## 1998. July 5 Beta-01
|
|
##
|
|
## Procedures
|
|
# Clear Log
|
|
|
|
proc Clear_Log {} {
|
|
global FONT F_COLOR B_COLOR
|
|
|
|
if {![winfo exists .log.text]} {
|
|
Message_Skeleton -icon warning -button O.K. \
|
|
-message "Warning!\nWhat's happen?"
|
|
if {$FONT != ""} {
|
|
Change_Font $FONT .msgskeleton
|
|
}
|
|
if {$F_COLOR != "" && $B_COLOR != ""} {
|
|
Change_Color $F_COLOR $B_COLOR .msgskeleton
|
|
}
|
|
.msgskeleton.butt.0 configure -command {destroy .msgskeleton}
|
|
return
|
|
}
|
|
|
|
if {![winfo exists .comm.ent]} {
|
|
Message_Skeleton -icon warning -button O.K. \
|
|
-message "Warning!\nWhat's happen?"
|
|
if {$FONT != ""} {
|
|
Change_Font $FONT .msgskeleton
|
|
}
|
|
if {$F_COLOR != "" && $B_COLOR != ""} {
|
|
Change_Color $F_COLOR $B_COLOR .msgskeleton
|
|
}
|
|
.msgskeleton.butt.0 configure -command {destroy .msgskeleton}
|
|
return
|
|
} else {
|
|
.comm.ent delete 0 end
|
|
}
|
|
|
|
set RANGE [.log.text tag range sel]
|
|
if {$RANGE == ""} {
|
|
Message_Skeleton -icon question -button {Yes No} \
|
|
-message "Check!\nClear whole log?"
|
|
if {$FONT != ""} {
|
|
Change_Font $FONT .msgskeleton
|
|
}
|
|
if {$F_COLOR != "" && $B_COLOR != ""} {
|
|
Change_Color $F_COLOR $B_COLOR .msgskeleton
|
|
}
|
|
.msgskeleton.butt.0 configure -command {
|
|
.log.text delete 1.0 end
|
|
destroy .msgskeleton
|
|
}
|
|
.msgskeleton.butt.1 configure -command {
|
|
destroy .msgskeleton
|
|
}
|
|
return
|
|
} else {
|
|
Message_Skeleton -icon question -button {Yes No} \
|
|
-message "Check!\nClear marked log?"
|
|
if {$FONT != ""} {
|
|
Change_Font $FONT .msgskeleton
|
|
}
|
|
if {$F_COLOR != "" && $B_COLOR != ""} {
|
|
Change_Color $F_COLOR $B_COLOR .msgskeleton
|
|
}
|
|
.msgskeleton.butt.0 configure -command {
|
|
.log.text tag remove sel 1.0 end
|
|
eval .log.text delete $RANGE
|
|
destroy .msgskeleton
|
|
}
|
|
.msgskeleton.butt.1 configure -command {
|
|
destroy .msgskeleton
|
|
}
|
|
return
|
|
}
|
|
}
|