home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 44
/
Amiga_Dream_44.iso
/
Linux
/
Pratique
/
Tcltk
/
tkcalc4.tcl
< prev
next >
Wrap
Text File
|
1997-09-10
|
1KB
|
70 lines
######################################
# tkcalc4.tcl #
######################################
# Tkcalculator v0.4 #
######################################
#################################
# Creer l'interface utilisateur #
#################################
proc MakeRow { list } {
global NbListRow
incr NbListRow
frame .framerow${NbListRow}
pack .framerow${NbListRow} -side top -fill x -expand true
for { set i 0 } { $i < [llength $list] } { incr i } {
button .btn${i}row${NbListRow} -command "ButtonCommand $i $NbListRow" -text [ lindex $list $i] -width 3 -height 1
pack .btn${i}row${NbListRow} -side left -in .framerow${NbListRow}
}
}
# bouton "a propos"
text .viewtxt -height 8 -width 32
pack .viewtxt -side top
set ListRow1 { 7 8 9 \/ "CE" }
set ListRow2 { 4 5 6 \* }
set ListRow3 { 1 2 3 \- }
set ListRow4 { 0 "+/-" \. \+ \= }
set NbListRow 0
MakeRow $ListRow1
MakeRow $ListRow2
MakeRow $ListRow3
MakeRow $ListRow4
frame .comframe
button .comframe.aboutbtn -text "About ..." -command AboutCommand
button .comframe.quitbtn -text "Quit" -command exit
pack .comframe -side top
pack .comframe.aboutbtn -side left
pack .comframe.quitbtn -side left
proc ButtonCommand { i row } {
puts "You choosed the $i-th button of row \#$row"
}
uplevel 0 [list source dialogs.tcl]