Attachment "t" to
ticket [3106443fff]
added by
stwo
2013-11-07 03:40:22.
--- modules/tooltip/tooltip.tcl.orig Wed Oct 30 14:44:52 2013
+++ modules/tooltip/tooltip.tcl Wed Nov 6 22:22:27 2013
@@ -116,7 +116,7 @@ proc ::tooltip::tooltip {w args} {
variable G
switch -- $w {
clear {
- if {[llength $args]==0} { set args .* }
+ if {[llength $args] == 0} { set args .* }
clear $args
}
delay {
@@ -176,7 +176,12 @@ proc ::tooltip::register {w args} {
set key [lindex $args 0]
while {[string match -* $key]} {
switch -- $key {
- -index {
+ -- {
+ set args [lreplace $args 0 0]
+ set key [lindex $args 0]
+ break
+ }
+ -index {
if {[catch {$w entrycget 1 -label}]} {
return -code error "widget \"$w\" does not seem to be a\
menu, which is required for the -index switch"
@@ -205,7 +210,7 @@ proc ::tooltip::register {w args} {
}
set args [lreplace $args 0 1]
}
- default {
+ default {
return -code error "unknown option \"$key\":\
should be -index, -items or -tag"
}
@@ -214,7 +219,7 @@ proc ::tooltip::register {w args} {
}
if {[llength $args] != 1} {
return -code error "wrong # args: should be \"tooltip widget\
- ?-index index? ?-items item? ?-tag tag? message\""
+ ?-index index? ?-items item? ?-tag tag? ?--? message\""
}
if {$key eq ""} {
clear $w
--- modules/tooltip/tooltip.man.orig Wed Oct 30 14:44:52 2013
+++ modules/tooltip/tooltip.man Wed Nov 6 22:36:06 2013
@@ -94,6 +94,11 @@ The [option -tag] option can be used to set a tooltip
tag. The tag should already be present when this command is called or
an error will be returned. The widget must also be a text widget.
+[opt_def --]
+
+The [option --] option marks the end of options.
+The argument following this one will be treated as [arg message] even if it starts with a -.
+
[list_end]
[list_end]