summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-27 11:58:20 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-27 11:58:20 (GMT)
commit729820db14607dca8ab6a8185bef5928b8bbed6f (patch)
tree2398fdd617e2e98ab71885b07c48a1b3418f1cb0
parent848a0b0986e95d797bcbb1f50240f345a9c2d9a9 (diff)
parentbe9d4efe7ba6f645e1cd3e8c93dfa13f634eb972 (diff)
downloadtk-729820db14607dca8ab6a8185bef5928b8bbed6f.zip
tk-729820db14607dca8ab6a8185bef5928b8bbed6f.tar.gz
tk-729820db14607dca8ab6a8185bef5928b8bbed6f.tar.bz2
[Bug 3608074]: Add <<Invoke>> bindings to Button's, Listbox and Menu.
Document <<Invoke>>, <<ThemeChanged>>, <<EnteredChild>> (ttk_pandedwindow only) and <<Increment/Decrement>> (ttk_spinbox only)
-rw-r--r--ChangeLog9
-rw-r--r--doc/event.n7
-rw-r--r--doc/ttk_panedwindow.n6
-rw-r--r--doc/ttk_spinbox.n5
-rw-r--r--library/button.tcl9
-rw-r--r--library/listbox.tcl3
-rw-r--r--library/menu.tcl7
-rwxr-xr-xwin/configure19
-rw-r--r--win/configure.in11
9 files changed, 76 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bf1258..cce8d3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-27 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * library/button.tcl: [Bug 3608074]: Add <<Invoke>> bindings to
+ * library/listbox.tcl: Button's, Listbox and Menu.
+ * library/menu.tcl:
+ * doc/event.n: Document <<Invoke>>, <<ThemeChanged>>,
+ * doc/ttk_panedwindow.n: <<EnteredChild>> (ttk_pandedwindow only) and
+ * doc/ttk_spinbox.n: <<Increment/Decrement>> (ttk_spinbox only)
+
2013-03-13 Jan Nijtmans <nijtmans@users.sf.net>
* unix/tcl.m4: Patch by Andrew Shadura, providing better support for
diff --git a/doc/event.n b/doc/event.n
index 52cb992..0c837e3 100644
--- a/doc/event.n
+++ b/doc/event.n
@@ -317,6 +317,10 @@ been pressed in combination with the Alt key. The usual response to
this is to either focus into the widget (or some related widget) or to
invoke the widget.
.TP
+\fB<<Invoke>>\fR
+This can be sent to some widgets (e.g. button, listbox, menu) as an
+alternative to <space>.
+.TP
\fB<<ListboxSelect>>\fR
This is sent to a listbox when the set of selected item(s) in the
listbox is updated.
@@ -333,6 +337,9 @@ changed.
This is sent to a text widget when the selection in the widget is
changed.
.TP
+\fB<<ThemeChanged>>\fR
+This is sent to a text widget when the ttk (Tile) theme changed.
+.TP
\fB<<TraverseIn>>\fR
This is sent to a widget when the focus enters the widget because of a
user-driven
diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n
index 3b80ac8..cde2cdc 100644
--- a/doc/ttk_panedwindow.n
+++ b/doc/ttk_panedwindow.n
@@ -105,6 +105,12 @@ and the total size of the widget.
.\" depending on which changed most recently.
Returns the new position of sash number \fIindex\fR.
.\" Full story: new position may be different than the requested position.
+.SH "VIRTUAL EVENTS"
+.PP
+The panedwindow widget generates an \fB<<EnteredChild>>\fR virtual event on
+LeaveNotify/NotifyInferior events, because Tk does not execute binding scripts
+for <Leave> events when the pointer crosses from a parent to a child. The
+panedwindow widget needs to know when that happens.
.SH "SEE ALSO"
ttk::widget(n), ttk::notebook(n), panedwindow(n)
'\" Local Variables:
diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n
index 2933ae7..67f397a 100644
--- a/doc/ttk_spinbox.n
+++ b/doc/ttk_spinbox.n
@@ -77,6 +77,11 @@ Set the spinbox string to \fIvalue\fR. If a \fB\-format\fR option has
been configured then this format will be applied. If formatting fails
or is not set or the \fB\-values\fR option has been used then the value
is set directly.
+.SH "VIRTUAL EVENTS"
+.PP
+The spinbox widget generates a \fB<<Increment>>\fR virtual event when
+the user presses <Up>, and a \fB<<Decrement>>\fR virtual event when the
+user presses <Down>.
.SH "SEE ALSO"
ttk::widget(n), ttk::entry(n), spinbox(n)
.SH KEYWORDS
diff --git a/library/button.tcl b/library/button.tcl
index a1f0a26..815b137 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -109,6 +109,15 @@ bind Checkbutton <space> {
bind Radiobutton <space> {
tk::CheckRadioInvoke %W
}
+bind Button <<Invoke>> {
+ tk::ButtonInvoke %W
+}
+bind Checkbutton <<Invoke>> {
+ tk::CheckRadioInvoke %W
+}
+bind Radiobutton <<Invoke>> {
+ tk::CheckRadioInvoke %W
+}
bind Button <FocusIn> {}
bind Button <Enter> {
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 01fb03d..3270b5d 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -142,6 +142,9 @@ bind Listbox <<Copy>> {
bind Listbox <space> {
tk::ListboxBeginSelect %W [%W index active]
}
+bind Listbox <<Invoke>> {
+ tk::ListboxBeginSelect %W [%W index active]
+}
bind Listbox <Select> {
tk::ListboxBeginSelect %W [%W index active]
}
diff --git a/library/menu.tcl b/library/menu.tcl
index cfe7536..5f46a01 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -106,6 +106,10 @@ bind Menubutton <space> {
tk::MbPost %W
tk::MenuFirstEntry [%W cget -menu]
}
+bind Menubutton <<Invoke>> {
+ tk::MbPost %W
+ tk::MenuFirstEntry [%W cget -menu]
+}
# Must set focus when mouse enters a menu, in order to allow
# mixed-mode processing using both the mouse and the keyboard.
@@ -143,6 +147,9 @@ bind Menu <ButtonRelease> {
bind Menu <space> {
tk::MenuInvoke %W 0
}
+bind Menu <<Invoke>> {
+ tk::MenuInvoke %W 0
+}
bind Menu <Return> {
tk::MenuInvoke %W 0
}
diff --git a/win/configure b/win/configure
index 77a0380..9efd2a9 100755
--- a/win/configure
+++ b/win/configure
@@ -3284,6 +3284,25 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6
+if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then
+ { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5
+echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test "${TCL_MINOR_VERSION}" -lt "${TK_MINOR_VERSION}"; then
+ { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5
+echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called
diff --git a/win/configure.in b/win/configure.in
index d411aff..709e64e 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -81,6 +81,17 @@ SC_ENABLE_SHARED
SC_PATH_TCLCONFIG($TK_PATCH_LEVEL)
SC_LOAD_TCLCONFIG
+if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then
+ AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.])
+fi
+if test "${TCL_MINOR_VERSION}" -lt "${TK_MINOR_VERSION}"; then
+ AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.])
+fi
+
#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called