Menu

#26 crash on attach (send)

open
None
5
2014-07-08
2003-06-16
No

I have an application which generates a menubar based
on text file. tkinspect apparently doesn't like
something associated with this menubar. Below is the
messages from the failure.

I am also attaching the Tcl/Tk code for the
application, plus the file menubar.txt which is used to
generate the menu bar.

In addition to the menubar, there are for buttons with
images; I am not including the images.

---- begin menubar.txt
# This is a comment. I love comments.
#
# This is the data for the main menu bar. Each menu
and submenu is
# described in a near-Tcl/Tk syntax. There is no
format requirement,
# but being readable is a plus.
#
# The menu is structured as a list of pairs. The menu
label appears
# followed by a list which contains options for the
menu followed by (as
# the last element of the list) a list of submenus.
#
# The submenus do not follow exactly the same syntax
simply because they
# are not constrained to be cascade buttons like the
main menu. Each
# element of the submenu list is a list whose first
element is the type
# of menu (suitable for passing to the -type option).
The second item
# is the menu label. Remaining items are options
suitable for passing
# directly to the resulting widget.
#
# The label "Help" (any case) is treated special and is
created as the
# canonical help menu item which means, depending on
your platform and
# window manager, it may get special placement.
#
# One caveat: the hash-mark '#' is treated special when
reading this
# file. From the point of the first hash-mark onward,
all characters in
# the line are discarded. So you can't put a hash-mark
in a menu item,
# no exceptions.
#
# The "cascade" declaration for submenus is redundant
and not symmetric
# with the top-level menu cascades.
#
File {
-underline 0 {
{command "Sign On..." -command "wm withdraw .;
mips::logon::getSignOn startup"}
{command "Sign Off" -state disabled}
{separator}
{command "Open..." -state disabled}
{command Save -state disabled}
{command "Save As..." -state disabled}
{separator}
{command Exit -command exit}
}
}
#Create {
# -underline 0 {
# {command Company -state disabled}
# {command Contact -state disabled}
# {command Portfolio -state disabled}
# {command Product -state disabled}
# }
#}
Search {
-underline 0 {
# {command Company -state disabled}
# {command Contact -state disabled}
# {command Portfolio -state disabled}
{command Product -command mips::product::NewQuery}
}
}
Help {
-underline 0 {
{command About... -state disabled}
}
}

---- end menubar.txt

wrong # args: should be "winfo children window"
wrong # args: should be "winfo children window"
while executing
"winfo children .menubar.mSearch.mcommand Product
-command mips::product::NewQuery"
invoked from within
"if {[::info command winfo] != {}} {
winfo children .menubar.mSearch.mcommand Product
-command mips::product::NewQuery
}"
invoked from within
"tk_send cps.tcl {if {[::info command winfo] != {}} {
winfo children .menubar.mSearch.mcommand Product
-command mips::product::NewQuery
}}"
("eval" body line 1)
invoked from within
"eval tk_send [list $app] $args"
invoked from within
"if [string match {[0-9]*} $app] {
eval comm::comm send [list $app] $args
} else {
eval tk_send [list $app] $args
..."
(procedure "send" line 2)
invoked from within
"send $target $cmd"
(procedure "windows_info:append_windows" line 5)
invoked from within
"windows_info:append_windows O_1 cps.tcl result
{.menubar.mSearch.mcommand Product -command
mips::product::NewQuery}"
("uplevel" body line 1)
invoked from within
"uplevel [concat $object(__class):$method O_1 $args]"
(procedure "O_1" line 3)
invoked from within
"$self append_windows $target result $w"
(procedure "windows_info:append_windows" line 7)
invoked from within
"windows_info:append_windows O_1 cps.tcl result
.menubar.mSearch"
("uplevel" body line 1)
invoked from within
"uplevel [concat $object(__class):$method O_1 $args]"
(procedure "O_1" line 3)
invoked from within
"$self append_windows $target result $w"
(procedure "windows_info:append_windows" line 7)
invoked from within
"windows_info:append_windows O_1 cps.tcl windows .menubar"
("uplevel" body line 1)
invoked from within
"uplevel [concat $object(__class):$method O_1 $args]"
(procedure "O_1" line 3)
invoked from within
"$self append_windows $target windows $w"
(procedure "windows_info:update" line 11)
invoked from within
"windows_info:update O_1 cps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel [concat $object(__class):$method O_1 $args]"
(procedure "O_1" line 3)
invoked from within
"$slot(windows_info) update $slot(target)"
(procedure "tkinspect_main:update_lists" line 4)
invoked from within
"tkinspect_main:update_lists .main0"
("uplevel" body line 1)
invoked from within
"uplevel [concat $object(__class):$method .main0 $args]"
(procedure ".main0" line 3)
invoked from within
"$self update_lists"
(procedure "tkinspect_main:set_target" line 11)
invoked from within
"tkinspect_main:set_target .main0 cps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel [concat $object(__class):$method .main0 $args]"
(procedure ".main0" line 3)
invoked from within
".main0 set_target cps.tcl"
invoked from within
".main0.menu.file.m.interps invoke active"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke active]"
(procedure "tk::MenuInvoke" line 47)
invoked from within
"tk::MenuInvoke .main0.menu.file.m.interps 1"
(command bound to event)

Discussion

  • Roland Roberts

    Roland Roberts - 2003-06-16

    Tcl application that crashes tkinspect

     
  • Pat Thoyts

    Pat Thoyts - 2003-06-20
    • assigned_to: nobody --> patthoyts
     

Log in to post a comment.