Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-01-2005, 04:20 AM   #1
LQ Newbie
Registered: Jan 2004
Location: Chicago, IL
Distribution: working on that
Posts: 4

Rep: Reputation: 0
Angry stupid tcl/tk error i can't debug

I keep getting a weird error in line 2 of logInPressA, saying that "" is an invalid command. Well, of course that makes sense, but I don't know how that error is getting there. This is all of the code that runs up til that error, so I don't see why I get it. Do any of you have any insight?

proc logIn { } {
    toplevel .login
    pack [label .login.l1 -text "Enter your username ( =<10 chars ) and the server IP" ] \
	-anchor n
    pack [frame .login.f1]
    pack [entry .login.f1.e1 -relief sunken ] -fill x
    pack [entry .login.f1.e2 -relief sunken ] -fill x
    pack [button .login.f1.b1 -text "Send" -command { logInPressA } ] \
	-anchor e 

# .login.f1.b1 -command start
proc logInPressA { } {
    puts "login [.login.f1.e2 cget -text] [.login.f1.e1 cget -text]"
    [ .login.l1 configure -text "Username request sent.  Please wait."]
    [ .login.f1.e2 configure -state disabled ]  
    [ .login.f1.e2 configure -state disabled ]

Old 06-27-2005, 07:32 AM   #2
LQ Newbie
Registered: Jun 2005
Posts: 11

Rep: Reputation: 0
The problem is putting the commands in [] in that proc. Remove the [] in the commands that are on lines by themselves and your error will go away.

[ .login.l1 configure -text "Username request sent. Please wait."]
[ .login.f1.e2 configure -state disabled ]
[ .login.f1.e2 configure -state disabled ]


.login.l1 configure -text "Username request sent. Please wait."
.login.f1.e2 configure -state disabled
.login.f1.e2 configure -state disabled

Otherwise, you are telling Tcl to execute a command returned by the configure statements - but the configure statement doesn't return a command to execute.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
tcl error ! wizex Debian 3 09-05-2005 03:21 PM error Jaykay3k Linux - Software 0 02-27-2005 12:35 PM
tcl/tk: Bwidget error Onemessedupjedi Programming 0 07-05-2004 05:24 PM
[debug]what does the following debug information mean icoming Programming 21 06-08-2004 02:13 AM
cvswinex debug error evensen Linux - Games 0 05-04-2004 10:30 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration