Posted to tcl by rszulgo at Tue Jan 12 02:32:18 GMT 2010view raw
- #!/usr/bin/tclsh
- package require Tk
-
- #\u0141adowanie biblioteki
- load tclsqlite-3.6.22.so sqlite3
-
- #\u0141\u0105czenie z baz\u0105 danych
- sqlite3 db baza.db
-
- #Wykonanie zapytania
- db eval {SELECT * FROM przedmioty} x {
-
- foreach v $x(*) {
- $msg = $v = $x($v)
- }
-
- puts ""
-
- }
-
- # Tworzymy wiadomosc
- message .m -text "Hello Tcl!" -background white
- pack .m -expand true -fill both -ipadx 100 -ipady 40
-
- # Tworzymy pasek menu z Menu "Help"
- menu .menubar
- menu .menubar.help -tearoff 0
- .menubar add cascade -label "Help" -menu .menubar.help -underline 0
- .menubar.help add command -label "O Hello ..." -accelerator "F1" -underline 0 -command showAbout
-
- # Define a procedure - an action for Help-About
- proc showAbout {} {
- tk_messageBox -message "Tcl/Tk\nWitamy na Zaawansowanej Analizie Danych\nVersion 1.0" -title "O Hello"
- }
-
-
-
-
- # Configure the main window
- wm title . "Zaawansowana Analiza Danych"
- . configure -menu .menubar -width 200 -height 150
-
- #Binding na skrót
- bind . "<Key F1>" {showAbout}
-
- db close