Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exit errors

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
0
0
AU
hi!

I have a button created with Bwidget:
$bbox add -image $exit -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 -helptext "Exit" -armcommand {Quit}

proc Quit {} {
exit
}

I get an error:
wrong # args: should be "exit option ?arg arg ...?"
wrong # args: should be "exit option ?arg arg ...?"
while executing
"exit"
(procedure "Quit" line 4)
invoked from within
"Quit"
("uplevel" body line 1)
invoked from within
"uplevel \#0 $cmd"
(procedure "Button::_press" line 9)
invoked from within
"Button::_press .mainframe.topf.tb0.bbox1.b0"
(command bound to event)

and if I put

proc Quit {} {
destroy .
}

I get an error:
can't unset "data": no such variable
while executing
"unset data"
(procedure "ButtonBox::_destroy" line 5)
invoked from within
"ButtonBox::_destroy .#BWidgetClass#ButtonBox"
(command bound to event)
can't read "data(pages)": no such variable
while executing
"foreach page $data(pages) {
Widget::destroy $path.f$page
}"
 
I think there might be more wrong with your code. Are you creating this inside of a class?
I created the following program and it worked:

package require BWidget

pack [ButtonBox .test]

set bbox .test

$bbox add -text "HELLO WORLD" -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 -helptext "Exit" -armcommand {Quit}

proc Quit {} {
exit
}
 
fab, this is rather strange indeed...
did u try that:
Code:
$bbox add -image $exit -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 -helptext "Exit" -armcommand {exit}

unless the interpretor does not like having a -image to be $exit as specified in your example...
 
Thanks! The problem was coming from namespaces conflicts between blt and bwidget extensions I am using..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top