Tk&tcl

Lefteris louther at thrace.louthernet.gr
Mon Jun 16 23:05:07 EEST 1997


Loipon ftiaxno ena programmataki se tk&tcl pou me syndeei sto internet kai
xronometraei posh ora eimai on-line...Einai to parakatv :

#!/usr/bin/wish

set mpimpikos 0
set online 0
label .counter -text 00.00.00 -relief sunken
button .start -text "  Connect  " -command {
 if $mpimpikos==0 {
  exec clink
  puts stdout "Connecting ...\n"
 }
 set mpimpikos 1
    if $stopped {
        set stopped 0
        tick
    }
}
button .stop -text Disconnect -command {set stopped 1
 exec ppp-off
 puts stdout "Disconnecting ...\n"
}
pack .counter -side right -fill both
label .l -text "   Time online : "
pack .l -side right
pack .start -side left -fill both -expand yes
set minutes 0
set seconds 0
set hundredths 0
set stopped 1

proc tick {} {
    global seconds hundredths stopped minutes
    if $stopped return
    after 50 tick
    set hundredths [expr $hundredths+5]
    if {$hundredths >= 100} {
        set hundredths 0
        set seconds [expr $seconds+1]
    }
    if {$seconds >= 60} {
        set minutes [expr $minutes+1]
        set seconds 0
    }
    .counter config -text [format "%02d.%02d.%02d" $minutes $seconds
$hundredths}

bind . <Control-c> {destroy .}
bind . <Control-q> {destroy .}
focus .

Opou clink einai to scriptaki pou me syndeei sthn compulink kai ppp-off
auto pou me xesyndeei.....
H xronometrhsh omos arxizei molis kaleitai to clink...Dhladh molis arxizei
na kalei.....Exei kaneis mia idea pos mporo na to kano na arxizei molis
syndeomai ? Dhladh me alla logia sthn tck&tcl pos tha mporo na elegxo an
eimai on-line h oxi ?

--
====================================================================
Gia na mathete pos na xrisimopoiite ton majordomo, stilte e-mail
sto "majordomo at argeas.argos.hol.gr" me 1 grammi sto keimeno: help
Ta archives tis listas einai sto http://www.argos.hol.gr/lists
Gia opoiodipote problima stilte  e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list