Codice Linux >Questo e' lo script, in chiaro: >------------ #funzione per inserire un testo nelle finestre di testo # InsrTxt(window testo) proc InsrTxt {w t} { #abilita l'inserzione $w configure -state normal #Prima cancella tutto $w delete 1.0 end #poi scrivi $w insert 1.0 $t #blocca tutto $w configure -state disabled return } #Funzioni per la ricerca proc c0 {} { global livello wt1 wt2 set livello 0 InsrTxt $wt1 "Faccia superiore delle foglie verde, grigio-verde,verde-biancastro, verde-oliva, verde-porpora" InsrTxt $wt2 "faccia superiore non colorata come sopra indicato" return } proc c1 {} { global livello wt1 wt2 set livello 1 InsrTxt $wt1 "Punti trasparenti presenti" InsrTxt $wt2 "Punti trasparenti mancanti" } proc c2 {} { global livello wt1 wt2 set livello 2 InsrTxt $wt1 "Apici fogliari fortemente convessi, foglie NON strettamente appressate, fessura leggermente spalancata" InsrTxt $wt2 "Apici fogliari NON fortemente convessi, foglie strettamente appressate, fessura NON spalancata" } proc c3 {} { global livello wt1 wt2 set livello 3 InsrTxt $wt1 "Punti trasparenti regolarmente distribuiti sulla faccia superiore" InsrTxt $wt2 "Punti trasparenti concentrati in linee indistinte" } proc c4 {} { global livello wt1 wt2 set livello 4 InsrTxt $wt1 "Linee rosse o brune presenti, spesso collegate e formanti disegni dendroidi" InsrTxt $wt2 "Linee rosse o brune assenti" } proc c5 {} { global livello wt1 wt2 set livello 5 InsrTxt $wt1 "Apici delle foglie fortemente convessi" InsrTxt $wt2 "Apici delle foglie NON fortemente convessi" } proc c6 {} { global livello wt1 wt2 set livello 6 InsrTxt $wt1 "Foglie strettamente appressate, fessura NON spalancata" InsrTxt $wt2 "Foglie NON strettamente appressate, fessura spalancata" } proc c7 {} { global livello wt1 wt2 set livello 7 InsrTxt $wt1 "Fessura profonda meno di 8 mm" InsrTxt $wt2 "Fessura profonda piu' di 8 mm." } proc c8 {} { global livello wt1 wt2 set livello 8 InsrTxt $wt1 "Fiore bianco, esamero" InsrTxt $wt2 "Fiore giallo, pentamero" } proc c9 {} { global livello wt1 wt2 set livello 9 InsrTxt $wt1 "Finestra grande, isole piccole, poche o assenti" InsrTxt $wt2 "Finestra assente o indistinta a causa della presenza di isole e di introflessioni del margine" } proc c10 {} { global livello wt1 wt2 set livello 10 InsrTxt $wt1 "Piante sempre grigio-verdi, finestra grande, talcolta ridotta dalla presenza di isole e introflessioni del margine" InsrTxt $wt2 "Piante talvolta brunastre o grigio-porpora, finestra grande, con poche isole piccole" } proc c11 {} { global livello wt1 wt2 set livello 11 InsrTxt $wt1 "Presenza di punti rossi e/o linee rosse o brune" InsrTxt $wt2 "Assenza di punti rossi e/o linee rosse o brune" } proc c12 {} { global livello wt1 wt2 set livello 12 InsrTxt $wt1 "Apici con piccoli punti rossi in rilievo" InsrTxt $wt2 "Non come indicato sopra" } proc c13 {} { global livello wt1 wt2 set livello 13 InsrTxt $wt1 "Finestra presente, fiore bianco" InsrTxt $wt2 "Finestra assente, fiore giallo" } proc c14 {} { global livello wt1 wt2 set livello 14 InsrTxt $wt1 "Fiore bianco, esamero" InsrTxt $wt2 "Fiore giallo" } proc c15 {} { global livello wt1 wt2 set livello 15 InsrTxt $wt1 "Finestra grande ed evidente, con poche isole grandi" InsrTxt $wt2 "Finestra indistinta, costituita da molte isole piccole e introflessioni dei margini" } proc c16 {} { global livello wt1 wt2 set livello 16 InsrTxt $wt1 "Finestra non evidente, isole indistinte" InsrTxt $wt2 "Finestra con isole evidenti" } proc c17 {} { global livello wt1 wt2 set livello 17 InsrTxt $wt1 "Apice delle foglie bianco o bianco-rosa" InsrTxt $wt2 "Non come indicato sopra" } proc c18 {} { global livello wt1 wt2 set livello 18 InsrTxt $wt1 "Apice delle foglie fortemente convesso" InsrTxt $wt2 "Apice delle foglie NON fortemente convesso" } proc c19 {} { global livello set livello 19 InsrTxt $wt1 "Finestra assente, fiore giallo" InsrTxt $wt2 "Finestra indistinta, formata da isole e introflessioni rotondeggianti, fiore bianco" } proc c20 {} { global livello wt1 wt2 set livello 20 InsrTxt $wt1 "Punti trasparenti presenti" InsrTxt $wt2 "Punti trasparenti NON presenti" } proc c21 {} { global livello wt1 wt2 set livello 21 InsrTxt $wt1 "Apice delle foglie rugoso a causa della presenza di sottilissime creste gessose" InsrTxt $wt2 "Non come indicato sopra" } proc c22 {} { global livello wt1 wt2 set livello 22 InsrTxt $wt1 "Finestra presente" InsrTxt $wt2 "Finestra assente" } proc c23 {} { global livello wt1 wt2 set livello 23 InsrTxt $wt1 "Apice delle foglie piano" InsrTxt $wt2 "Apice delle foglie leggermente convesso" } proc c24 {} { global livello wt1 wt2 set livello 24 InsrTxt $wt1 "Foglie uniformemente rosso-porpora" InsrTxt $wt2 "Colore non come indicato sopra" } proc c25 {} { global livello wt1 wt2 set livello 25 InsrTxt $wt1 "Apice delle foglie brunastro" InsrTxt $wt2 "Colore non come indicato sopra" } proc c26 {} { global livello wt1 wt2 set livello 26 InsrTxt $wt1 "Punti trasparenti presenti" InsrTxt $wt2 "Punti trasparenti NON presenti" } proc c27 {} { global livello wt1 wt2 set livello 27 InsrTxt $wt1 "Finestra presente" InsrTxt $wt2 "Finestra assente" } proc c28 {} { global livello wt1 wt2 set livello 28 InsrTxt $wt1 "Apice delle foglie piano" InsrTxt $wt2 "Non come indicato sopra" } proc c29 {} { global livello wt1 wt2 set livello 29 InsrTxt $wt1 "Linee brune o rosse presenti" InsrTxt $wt2 "Linee brune o rosse NON presenti" } proc c30 {} { global livello wt1 wt2 set livello 30 InsrTxt $wt1 "Numerosi punti trasparenti, regolarmente distribuiti sugli apici, finestra piccola" InsrTxt $wt2 "Pochi punti trasparenti, finestra spesso grande" } proc c31 {} { global livello wt1 wt2 set livello 31 InsrTxt $wt1 "Linee rosse o brune assenti" InsrTxt $wt2 "Linee rosse o brune presenti" } proc c32 {} { global livello wt1 wt2 set livello 32 InsrTxt $wt1 "Apice delle foglie piano" InsrTxt $wt2 "Apice delle foglie convesso" } proc c33 {} { global livello wt1 wt2 set livello 33 InsrTxt $wt1 "Linee riunite a formare disegni dendroidi" InsrTxt $wt2 "Non come indicato sopra" } proc c34 {} { global livello wt1 wt2 set livello 34 InsrTxt $wt1 "Apice delle foglie piano" InsrTxt $wt2 "Apice delle foglie convesso" } proc c35 {} { global livello wt1 wt2 set livello 35 InsrTxt $wt1 "Fiorisce in luglio" InsrTxt $wt2 "Fiorisce da settembre a ottobre" } proc c36 {} { global livello wt1 wt2 set livello 36 InsrTxt $wt1 "Apice delle foglie fortemente convesso" InsrTxt $wt2 "Apice delle foglie NON fortemente convesso" } proc c37 {} { global livello wt1 wt2 set livello 37 InsrTxt $wt1 "Linee e disegni impressi rendono l'apice delle foglie rugoso" InsrTxt $wt2 "Non come indicato sopra" } proc c38 {} { global livello wt1 wt2 set livello 38 InsrTxt $wt1 "Apice con numerosi punti grandi, blu-verde scuro, trasparenti, fino a 1/2 mm di diametro" InsrTxt $wt2 "Punti trasparenti indistinti" } proc c39 {} { global livello wt1 wt2 set livello 39 InsrTxt $wt1 "Finestra presente" InsrTxt $wt2 "Finestra assente" } proc c40 {} { global livello wt1 wt2 set livello 40 InsrTxt $wt1 "Presenti punti e linee rosse" InsrTxt $wt2 "Assenti punti e linee rosse" } proc c41 {} { global livello wt1 wt2 set livello 41 InsrTxt $wt1 "Linee e disegni impressi rendono l'apice fogliare rugoso con infossature" InsrTxt $wt2 "Linee e disegni non impressi, apice liscio" } proc c42 {} { global livello wt1 wt2 set livello 42 InsrTxt $wt1 "Apici con piccoli punti rossi in rilievo" InsrTxt $wt2 "Non come indicato sopra" } proc c43 {} { global livello wt1 wt2 set livello 43 InsrTxt $wt1 "Apice delle foglie piano" InsrTxt $wt2 "Apice delle foglie leggermente convesso" } proc c44 {} { global livello wt1 wt2 set livello 44 InsrTxt $wt1 "Finestra grande, qualora presenti, isole in numero scarso" InsrTxt $wt2 "Finestra indistinta a causa delle presenza di introflessioni del margine" } proc c45 {} { global livello wt1 wt2 set livello 45 InsrTxt $wt1 "Fiore giallo, esamero" InsrTxt $wt2 "Fiore bianco, pentamero" } proc c46 {} { global livello wt1 wt2 set livello 46 InsrTxt $wt1 "Apice delle foglie piano" InsrTxt $wt2 "Apice delle foglie leggermente convesso" } proc c47 {} { global livello wt1 wt2 set livello 47 InsrTxt $wt1 "Punti trasparenti assenti, fiore bianco" InsrTxt $wt2 "Punti trasparenti presenti, fiore giallo" } proc c48 {} { global livello wt1 wt2 set livello 48 InsrTxt $wt1 "Punti rossi presenti" InsrTxt $wt2 "Punti rossi assenti" } proc c49 {} { global livello wt1 wt2 set livello 49 InsrTxt $wt1 "Finestra presente" InsrTxt $wt2 "Finestra assente" } #Ora i comandi associati ai bottoni proc bc1Click {} { global livello switch $livello { 0 { c1 } 1 { c2 } 2 { c3 } 3 {trovato "localis"} 4 {trovato "pseudotruncatella"} 5 { c6 } 6 {trovato "olivacea"} 7 {trovato "optica"} 8 { c9 } 9 {trovato "marmorata"} 10 {trovato "helmutii"} 11 { c12 } 12 {trovato "verruculosa"} 13 {trovato "salicola"} 14 {trovato "villetii"} 15 {trovato "otzeniana"} 16 {trovato "meyeri"} 17 { c18 } 18 { c19 } 19 {trovato "ruschiorum"} 20 {trovato "pseudotruncatella"} 21 {trovato "vallis-mariae"} 22 {trovato "julii"} 23 {trovato "karasmontana"} 24 {trovato "optica var.rubra"} 25 { c26 } 26 { c27 } 27 { c28 } 28 { c29 } 29 {trovato "bromfeldii"} 30 {trovato "localis"} 31 { c32 } 32 {trovato "aucampiae"} 33 { c34 } 34 { c35 } 35 {trovato "pseudotruncatella"} 36 {trovato "steineckeana"} 37 { c38 } 38 {trovato "fulviceps"} 39 { c40 } 40 { c41 } 41 { c42 } 42 {trovato "verruculosa"} 43 {trovato "julii"} 44 {trovato "salicola"} 45 {trovato "turbiniformis"} 46 {trovato "karasmontana"} 47 {trovato "deboeri"} 48 { c49 } 49 {trovato "dinteri"} } } proc bc2Click {} { global livello switch $livello { 0 { c17 } 1 { c5 } 2 { c4 } 3 {trovato "francisci"} 4 {trovato "lesliei"} 5 { c11 } 6 { c7 } 7 { c8 } 8 { c10 } 9 {trovato "elisae"} 10 {trovato "comptonii"} 11 { c15 } 12 { c13 } 13 {trovato "archerae"} 14 { c15 } 15 { c16 } 16 {trovato "herrei"} 17 { c24 } 18 { c20 } 19 {trovato "elisae"} 20 { c21 } 21 { c22 } 22 { c23 } 23 {trovato "erniana"} 24 { c25 } 25 { c47 } 26 { c39 } 27 { c31 } 28 { c30 } 29 {trovato "lesliei"} 30 {trovato "francisci"} 31 { c33 } 32 {trovato "localis"} 33 { c36 } 34 {trovato "werneri"} 35 {trovato "schwantesii"} 36 { c37 } 37 {trovato "glaudinae"} 38 {trovato "marginata"} 39 { c45 } 40 {trovato "villetii"} 41 { c44 } 42 { c43 } 43 {trovato "bella"} 44 {trovato "dorotheae"} 45 { c46 } 46 {trovato "erniana"} 47 { c48 } 48 {trovato "werneri"} 49 {trovato "schwantesii"} } } #Procedura trovato proc trovato {ELui} { global wt1 wt2 InsrTxt $wt1 "Identificato!\nLithops N.E.Br $ELui" InsrTxt $wt2 "Fai click su Nuova Ricerca per continuare o Exit per finire" } #procedura per la finestra di help #W e' la finestradi help proc helpClick {} { global framesup framecent frameinf xside set r(1) "Leggendo il libro \"Le Pietre Vive\" mi e' venuta l'idea di scrivere poche righe di codice che " set r(2) "mi aiutassero nell'identificazione delle lithops secondo la chiavi per la specie " set r(3) "di B. Fearn che, anche se non e' la piu' completa, e' di uso semplice specie per chi sta " set r(4) "iniziando con queste piante.....\n" set r(5) "\nTermini :\nPuntini Blu :\nPiccolissime finestre che si trovano al di sotto" set r(6) "dell'epidermide, i limiti sono indistinti e le stesse non vanno confuse con le macchie translucide che" set r(7) "fanno parte del tessuto epidermico.\n" set r(8) "Dendroide:\nDi aspetto ramificato, simile ad un albero.\n" set r(9) "Finestra:\nZona trasparente che si trova sulla superficie terminale dei lobi" set r(10) "Talora ricopre completamente questa superficie, altre volte e' ramificata in striscie + o - delimitate e + o - sottili\n" set r(11) "Isola:\nParte non trasparente della superficie terminale che e' circondata dalla finestra\n" set r(12) "Punti translucidi:\nPuntini (diametro max 1mm) normalmente verdastro o azzurrognolo, distribuiti sulla " set r(13) "parte superiore del corpo.\n" set r(14) "\nNessun Copyright 1999 Robertone tattola(at)hotmail(dot)com" set r(15) "\n" set r(16) "\nTradotto in Tcl/Tk su MacOS 8.1 da Ermanno Polli nell'agosto 2000 - ermanno(dot)polli(at)lnf(dot)infn(dot)it " set r(17) "\n" set r(18) "\n" set r(19) "\n" set TEnd 19 #disegno la finestra di help #finestra di help (due frames: messaggio e bottone "OK") set HelpF .help set HelpW $HelpF.help set HelpFh [expr $framesup+$framecent+($frameinf/2)] set HelpB .helpButton set HokB $HelpB.hOK set HelpBh [expr $frameinf/2] frame $HelpF -width $xside -height $HelpFh -background yellow place $HelpF -x 0 -y 0 message $HelpW -font helpFont -bg grey -width $xside frame $HelpB -width $xside -height $HelpBh -background blue place $HelpB -x 0 -y $HelpFh button $HokB -text "OK" -background gray -command "destroy $HelpF $HelpB" place $HokB -rely 0.5 -y -8 -relx 0.45 set helpText "" for { set i 1} { $i <= $TEnd} { incr i} { set helpText "$helpText$r($i)" } $HelpW configure -text $helpText place $HelpW -x 0 -y 0 } # main window bloccata set xside 400 set yside 300 set Txside [expr $xside*0.70] #altezza dei tre frame: la somma e' yside set framesup 120 set framecent 120 set frameinf 60 set newGeom $xside\x$yside wm geometry . $newGeom # . configure -background green wm minsize . $xside $yside wm maxsize . $xside $yside wm title . "Lithops" #frames set sup .f1 set cent .f2 set inf .f3 frame $sup -width $Txside -height $framesup -background green frame $cent -width $Txside -height $framecent -background green frame $inf -width $xside -height $frameinf -background green place $sup -x 0 -y 0 -width $xside -height $framesup place $cent -x 0 -y $framesup -width $xside -height $framecent place $inf -x 0 -y [expr $framesup+$framecent] -width $xside -height $frameinf # finestre di testo set wt1 $sup.tChar1 set wt2 $cent.tChar2 text $wt1 -font *-Courier-*-100-* -relief sunken -width 40 -height 7 -state disabled -background cyan -bd 3 -wrap word text $wt2 -font *-Courier-*-100-* -relief sunken -width 40 -height 7 -state disabled -background cyan -bd 3 -wrap word #identificatore per tutto il testo nella finestra $wt1 tag add Tutto 1.0 end $wt2 tag add Tutto 1.0 end $wt1 tag configure Tutto -justify right $wt2 tag configure Tutto -justify right pack $wt1 -padx 20 -pady 10 -anchor w -side left pack $wt2 -padx 20 -pady 10 -anchor w -side left #Per la finesra di help font create helpFont -size 10 -family Times #bottoni di selezione set b1 $sup.bc1 set b2 $cent.bc2 button $b1 -text "E' lui!" -background gray -command bc1Click button $b2 -text "E' lui!" -background gray -command bc2Click pack $b1 -side left pack $b2 -side left #bottoni di servizio set exit $inf.close set help $inf.help set start $inf.start button $exit -text "Exit" -background gray -command exit button $help -text "help" -background gray -command helpClick button $start -text "Nuova ricerca" -background gray -command c0 place $start -rely 0.5 -y -8 -relx 0.1 place $help -rely 0.5 -y -8 -relx 0.5 place $exit -rely 0.5 -y -8 -relx 0.8 #partenza c0