Previous
Tcl/Tk Tutorial - Create GUI using Tk with Tcl Language 
Next
Legal 
Tcl/Tk Tutorial - Create GUI using Tk with Tcl Language
Contents

A Tcl(Tutorial for Cool Languages) for Tcl/Tk : Contents

Starting Page
Contents
Legal
Introduction

TCL

Syntax
Hello World Program
Exercise
String Manipulation
Lists
Lists
Arrays
Control Flow
If statement
For and Foreach
For
Foreach
While
Switch
Functions

File Handling
open
puts
close
gets
seek
read

TK

TK
Widgets 1
Button
Entry
Label
Widgets 2
Frame
Text
Scrollbar
Scale
Grid
Widgets 3
Radiobutton
Checkbutton
Widgets 4
Listbox
Widgets 5
Menubutton
Menu
tk_optionMenu
Widgets 6
Canvas
Message
Panedwindow
Spinbox
Dialogs
tk_messageBox
tk_chooseDirectory
tk_chooseColor
tk_getOpenFile
toplevel
Geometry Managers
Grid
Pack
Common Options
Some Tk Commands
Bind

The End

What Now?
Reference
Appendix
A. Answers
B. Common Tcl/Tk Mistakes
C. Tcl/Tk in Unix
D. About the Author - Site
E. Codes
F. FeedBack/Rate the Tutorial.
G. What's New.
Previous
Tcl/Tk Tutorial - Create GUI using Tk with Tcl Language 
Next
Legal 

Comments

Biplab Banerjee at 01 Mar, 2008 10:07
Sir,
How can I insert a data inserted in a textbox into database in TCL-TK????
Reply to this.
Anonymous at 28 May, 2008 12:30
Hello all,
how do i link an executable C file with the button ????? Plz help..
thanks,
Reply to this.
Anonymous at 12 Aug, 2008 10:30
Hi,

How Can I read a user data interactively? or How can I read a data entered in text box to be used in a procedure?

Thanks.
Reply to this.
Anonymous at 29 Sep, 2008 09:33
Sir,
How can I use Tcl steal space telescope for benefit glorious nation of Kazakhstan? Plz send codes thx.
Reply to this.
Andy at 09 Oct, 2008 03:09
Hi Binny!

Thanks a lot for this tutorial. I came here for the Tk portion, and find your website very concise and to the point --a great way to get started on Tcl/Tk.
Reply to this.
Anonymous at 03 Jan, 2009 11:11
Hi I am a newbie to Tcl.

How do I insert data from a database into a text box? The code I have constructed is ...

# +-------------------------------------------------+
# + Initial TK Widget Definitions For Viewer Window +
# +-------------------------------------------------+
wm title . "mysqltcl: login"
# +--------------+
# + Menu Widgets +
# +--------------+

panedwindow .p -orient vertical -showhandle 1
pack .p -expand yes -fill both

# create labelframe widget, containing a gridded text and scrollbar assembly

foreach {w label} {result "Query result:"} {
set f [labelframe .p.$w -text $label]
text $f.t -height 10 -width 40 \
-wrap none -font {courier 12} \
-xscrollcommand [list $f.xbar set] \
-yscrollcommand [list $f.ybar set]
scrollbar $f.xbar -orient horizontal \
-command [list $f.t xview]
scrollbar $f.ybar -orient vertical \
-command [list $f.t yview]
grid $f.t -row 0 -column 0 -sticky news -padx 2 -pady 2
grid $f.ybar -row 0 -column 1 -sticky ns -padx 2 -pady 2
grid $f.xbar -row 1 -column 0 -sticky ew -padx 2 -pady 2
grid columnconfigure $f 0 -weight 1
grid rowconfigure $f 0 -weight 1

#add the frame assembly to the panedwindow

.p add $f -minsize 1i -padx 4 -pady 6

}

set h [mysqlconnect -db homeinfo -port 3309 -user me -password mypassword]

mysqluse $h "mydatabase"
mysqlsel $h "select title, author from books" -list

#using fetch

# while {[llength [set row [mysql::fetch $h]]]>0} {
# # row is always a list. using lindex avoids conversion list to string
# $t get {[lindex $row 0]}
#
# }

mysql::map $h host {
t -text insert end [puts $h]

}



label .fllabel -text "test" -relief sunken -bg NavajoWhite2 -fg Navy -anchor nw
#pack .fl .fllabel .flname -side top -padx 1m -pady 1m -anchor nw

button .getconnected -text "Connect to MySQL" -command getConnected


button .exitpgm -text "Exit Program" -fg Navy -bg NavajoWhite2 -font bold -command exitpgm
pack .exitpgm .getconnected \
-side bottom -padx 1m -pady 1m

#pack .flhost .flport .fluser .flconnection -side bottom -padx 1m -pady 1m

Thanks

Michael
Reply to this.
Manish at 04 Feb, 2009 03:29
Hi ,

I am a newbie to Tk ?..Can somebody tell me if Tk can be used to read data from UNIX based GUI interfaces.?
Reply to this.
Anonymous at 24 Jan, 2010 07:19
Hi
Like everyone else, I'm an anoymous poster trying to get everyone else to do my work for me. Why don't I go do some research rather than just asking questions and not contributing to anything anyone else has posted?
Reply to this.
Comment

Please dont enter you comments in this form - this is a fake form to confuse spamming bots. The next form is the real one.




Comment




Comment Formating : HTML tags a, strong, em, b, i, code, pre, p and br allowed. Other tags will be shown as code(< will become &lt;). Urls, Line breaks will be auto-formated.
Subscribe to Feed