bad option "delete": must configure 
Author Message
 bad option "delete": must configure

I get this when I run the script
Sorry about being a newbie on this.

bad option "delete":  must be configure
    while executing
".ltext1 delete 0.0 end"
    (procedure "updateScreen" line 3)
    invoked from within
"updateScreen"
    (file "s" line 44)
    invoked from within

Heres the code

#!/usr/local/bin/wish -f
wm title . "Internet Monitor"

frame .lframe

button .button -text "Quit" -command "exit"

label .label1 -text "   FTP Users: "  
label .ltext1 -textvariable ftpprocs -relief sunken -width 5

pack .label1 .ltext1 -in .lframe -side bottom -fill both

pack .button -side bottom

proc updateScreen {} {
        set ftpprocs [ exec ps -eaf | grep -v grep | grep ftp | wc -l ]
        .ltext1 delete 0.0 end
        .ltext1 insert end $ftpprocs

        after 50 updateScreen

Quote:
}

updateScreen

Please mail me at



Sat, 19 Jul 1997 08:37:50 GMT  
 bad option "delete": must configure
|> I get this when I run the script
|> Sorry about being a newbie on this.
|> #!/usr/local/bin/wish -f
|> wm title . "Internet Monitor"
|>
|> frame .lframe
|>
|> button .button -text "Quit" -command "exit"
|>
|> label .label1 -text "   FTP Users: "  
|> label .ltext1 -textvariable ftpprocs -relief sunken -width 5
|>
|> pack .label1 .ltext1 -in .lframe -side bottom -fill both
|>
|> pack .button -side bottom
|>
|> proc updateScreen {} {
|>   set ftpprocs [ exec ps -eaf | grep -v grep | grep ftp | wc -l ]
|>   .ltext1 delete 0.0 end
|>   .ltext1 insert end $ftpprocs
|>
|>   after 50 updateScreen
|> }
|>
|> updateScreen

This is a slightly edited version of a script that I sent you.
Unfortunately, you introduced bugs when you edited it.

.ltext1 was originally a `text', since your original question had
it as a long multi-line display (the whole output of ps was going into it).

There's no need for .lframe, and you aren't managing its geometry
anywhere; just pack .ltext1 and .label1 in the main window.

Since the code was originally written for texts, not labels, the
`delete' and `insert commands are wrong.  Either make .ltext1 a
text again, and remove the -textvariable option, or else keep the
-textvariable option, declare ftpprocs to be global inside the
updateScreen procedure, and remove the `delete' and `insert' commands
altogether.

--
73 de ke9tv/2, Kevin KENNY      GE Corporate R&D, Niskayuna, New York, USA



Sun, 20 Jul 1997 02:34:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. TclError: bad option "<whatever>": must be cget or configure

2. bad option "identify"

3. bad option "_scrollWidget" when Freewrapped

4. Problem "bad option delta" with Scrollbar

5. bad selection option "from"

6. configure "ini" file

7. "configure top-level entity"??

8. configuring "generated" components

9. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

10. ".w configure" for self defined widgets

11. .button "configure" returns wrong information

12. "./configure" on SUNOS

 

 
Powered by phpBB® Forum Software