summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-07 15:10:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-07 15:10:06 (GMT)
commit5450612a4d1bd4e6f796f76f12f3d216dfc935ba (patch)
treec2e820d3b669927a653a030f0d6ec2ac466b44cf
parent526bccf8bf38fe66da8e6e951cca4435c30869d9 (diff)
downloadtk-5450612a4d1bd4e6f796f76f12f3d216dfc935ba.zip
tk-5450612a4d1bd4e6f796f76f12f3d216dfc935ba.tar.gz
tk-5450612a4d1bd4e6f796f76f12f3d216dfc935ba.tar.bz2
More warnings -Wshadow with C++ compiler. Simplify <KeyPress> -> <Key>
-rw-r--r--ChangeLog4
-rw-r--r--changes6
-rw-r--r--generic/tkCanvas.c4
-rw-r--r--generic/tkImgPNG.c4
-rw-r--r--generic/tkImgSVGnano.c6
-rw-r--r--generic/tkTest.c14
-rw-r--r--macosx/tkMacOSXScrlbr.c2
-rw-r--r--tests/bind.test20
-rw-r--r--tests/imgPhoto.test2
-rw-r--r--win/tkWinMenu.c4
10 files changed, 33 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index f01946a..4fbb0eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -714,7 +714,7 @@ a better first place to look now.
2011-10-27 Kevin B. Kenny <kennykb@acm.org>
* generic/tkInt.h: [Bug 3410609]: Change the event mechanism
- * unix/tkUnixEvent.c: for <KeyPress> events to use the keysym
+ * unix/tkUnixEvent.c: for <Key> events to use the keysym
* unix/tkUnixKey.c: returned by XLookupString in preference to
the one that appears in the raw X event at any level. This change
allows binding to ISO_Level3_Shift-ed characters, composed characters,
@@ -5213,7 +5213,7 @@ a better first place to look now.
2008-01-29 Joe English <jenglish@users.sourceforge.net>
- * library/treeview.tcl: Fix bug in Shift-ButtonPress-1 binding (error
+ * library/treeview.tcl: Fix bug in Shift-Button-1 binding (error
if no current focus item; reported on c.l.t.)
2008-01-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
diff --git a/changes b/changes
index 61aff06..b83c642 100644
--- a/changes
+++ b/changes
@@ -333,7 +333,7 @@ same menu.
4/12/92 (bug fix) Fixed core dump that occurred in tkError.c when
removing the first error record from the error list.
-4/15/92 (bug fix) Fixed bug in tkBind.c that prevented <KeyPress-1>
+4/15/92 (bug fix) Fixed bug in tkBind.c that prevented <Key-1>
event specifications from being processed correctly: the "1" was
treated as a button name rather than a keysym.
@@ -3998,7 +3998,7 @@ into account the "-displayof" option. This problem also existed for the
command to the Mac. Also fixed "resource write" when the resource
was specified by id and already existed. (JI)
-9/16/97 (bug fix) Added null bindings to <Command-KeyPress> for the
+9/16/97 (bug fix) Added null bindings to <Command-Key> for the
text and entry widget on the Macintosh. This prevents unbound command
key sequences from having the character echoed to the widget. Also
fixed Cut & Copy bindings. (JI) (RJ)
@@ -7527,7 +7527,7 @@ in this changeset (new minor version) rather than bug fixes:
2018-01-07 (bug)[fa8de7] Crash [ttk::checkbutton .x -variable {}] (werner)
-2018-01-16 (bug)[382712] Crash in [event generate . <KeyPress>] (werner)
+2018-01-16 (bug)[382712] Crash in [event generate . <Key>] (werner)
2018-01-19 (bug)[657c38] Crash in menu destroy with checkbutton entry (werner)
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 3bdfd00..3dd1403 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -852,7 +852,7 @@ CanvasWidgetCmd(
"scan", "select", "type", "xview",
"yview", NULL
};
- enum options {
+ enum canvasOptionStringsEnum {
CANV_ADDTAG, CANV_BBOX, CANV_BIND, CANV_CANVASX,
CANV_CANVASY, CANV_CGET, CANV_CONFIGURE, CANV_COORDS,
CANV_CREATE, CANV_DCHARS, CANV_DELETE, CANV_DTAG,
@@ -876,7 +876,7 @@ CanvasWidgetCmd(
Tcl_Preserve(canvasPtr);
result = TCL_OK;
- switch ((enum options)idx) {
+ switch ((enum canvasOptionStringsEnum)idx) {
case CANV_ADDTAG:
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg ...?");
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index 0e0e59c..c8b2125 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -2295,7 +2295,7 @@ ParseFormat(
static const char *const fmtOptions[] = {
"-alpha", NULL
};
- enum fmtOptions {
+ enum fmtOptionsEnum {
OPT_ALPHA
};
@@ -2332,7 +2332,7 @@ ParseFormat(
objc--;
objv++;
- switch ((enum fmtOptions) optIndex) {
+ switch ((enum fmtOptionsEnum) optIndex) {
case OPT_ALPHA:
if (Tcl_GetDoubleFromObj(interp, objv[0],
&pngPtr->alpha) == TCL_ERROR) {
diff --git a/generic/tkImgSVGnano.c b/generic/tkImgSVGnano.c
index c18b181..4cdb648 100644
--- a/generic/tkImgSVGnano.c
+++ b/generic/tkImgSVGnano.c
@@ -336,7 +336,7 @@ ParseSVGWithOptions(
static const char *const fmtOptions[] = {
"-dpi", "-scale", "-scaletoheight", "-scaletowidth", NULL
};
- enum fmtOptions {
+ enum fmtOptionsEnum {
OPT_DPI, OPT_SCALE, OPT_SCALE_TO_HEIGHT, OPT_SCALE_TO_WIDTH
};
@@ -394,7 +394,7 @@ ParseSVGWithOptions(
/*
* check that only one scale option is given
*/
- switch ((enum fmtOptions) optIndex) {
+ switch ((enum fmtOptionsEnum)optIndex) {
case OPT_SCALE:
case OPT_SCALE_TO_HEIGHT:
case OPT_SCALE_TO_WIDTH:
@@ -414,7 +414,7 @@ ParseSVGWithOptions(
/*
* Decode parameters
*/
- switch ((enum fmtOptions) optIndex) {
+ switch ((enum fmtOptionsEnum) optIndex) {
case OPT_DPI:
if (Tcl_GetDoubleFromObj(interp, objv[0], &dpi) == TCL_ERROR) {
goto error;
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 2622c9c..4347600 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -538,7 +538,7 @@ TestobjconfigObjCmd(
* "chain2" subcommand:
*/
- typedef struct ExtensionWidgetRecord {
+ typedef struct {
TrivialCommandHeader header;
Tcl_Obj *base1ObjPtr;
Tcl_Obj *base2ObjPtr;
@@ -566,7 +566,7 @@ TestobjconfigObjCmd(
switch (index) {
case ALL_TYPES: {
- typedef struct TypesRecord {
+ typedef struct {
TrivialCommandHeader header;
Tcl_Obj *booleanPtr;
Tcl_Obj *integerPtr;
@@ -784,7 +784,7 @@ TestobjconfigObjCmd(
}
case CONFIG_ERROR: {
- typedef struct ErrorWidgetRecord {
+ typedef struct {
Tcl_Obj *intPtr;
} ErrorWidgetRecord;
ErrorWidgetRecord widgetRecord;
@@ -838,7 +838,7 @@ TestobjconfigObjCmd(
* objects.
*/
- typedef struct InternalRecord {
+ typedef struct {
TrivialCommandHeader header;
int boolean;
int integer;
@@ -969,7 +969,7 @@ TestobjconfigObjCmd(
}
case NEW: {
- typedef struct FiveRecord {
+ typedef struct {
TrivialCommandHeader header;
Tcl_Obj *one;
Tcl_Obj *two;
@@ -1028,7 +1028,7 @@ TestobjconfigObjCmd(
break;
}
case NOT_ENOUGH_PARAMS: {
- typedef struct NotEnoughRecord {
+ typedef struct {
Tcl_Obj *fooObjPtr;
} NotEnoughRecord;
NotEnoughRecord record;
@@ -1058,7 +1058,7 @@ TestobjconfigObjCmd(
}
case TWO_WINDOWS: {
- typedef struct ContentRecord {
+ typedef struct {
TrivialCommandHeader header;
Tcl_Obj *windowPtr;
} ContentRecord;
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c
index 8483cbb..3149b15 100644
--- a/macosx/tkMacOSXScrlbr.c
+++ b/macosx/tkMacOSXScrlbr.c
@@ -662,7 +662,7 @@ UpdateControlValues(
*
* ScrollbarEvent --
*
- * This procedure is invoked in response to <ButtonPress>,
+ * This procedure is invoked in response to <Button>,
* <ButtonRelease>, <EnterNotify>, and <LeaveNotify> events. The
* Scrollbar appearance is modified for each event.
*
diff --git a/tests/bind.test b/tests/bind.test
index 29f8873..2685946 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -5544,13 +5544,13 @@ test bind-26.6 {event names: ButtonPress} -setup {
focus -force .t.f
update
} -body {
- bind .t.f <ButtonPress> "set x {event ButtonPress}"
+ bind .t.f <Button> "set x {event Button}"
set x xyzzy
- event generate .t.f <ButtonPress>
+ event generate .t.f <Button>
list $x [bind .t.f]
} -cleanup {
destroy .t.f
-} -result {{event ButtonPress} <Button>}
+} -result {{event Button} <Button>}
test bind-26.7 {event names: ButtonRelease} -setup {
frame .t.f -class Test -width 150 -height 100
@@ -5642,9 +5642,9 @@ test bind-26.13 {event names: KeyPress} -setup {
focus -force .t.f
update
} -body {
- bind .t.f <KeyPress> "set x {event KeyPress}"
+ bind .t.f <Key> "set x {event KeyPress}"
set x xyzzy
- event generate .t.f <KeyPress>
+ event generate .t.f <Key>
list $x [bind .t.f]
} -cleanup {
destroy .t.f
@@ -6767,7 +6767,7 @@ test bind-33.19 {simulate use of the keyboard to trigger a pattern sequence with
set x {}
} -body {
bind .t.f <Escape><Control-c> { lappend x "Esc_Control-c" }
- bind .t.f <Escape><KeyPress><KeyPress><Control-c> { lappend x "Esc_Key(2)_Control-c" }
+ bind .t.f <Escape><Key><Key><Control-c> { lappend x "Esc_Key(2)_Control-c" }
event generate .t.f <Escape>
event generate .t.f <Alt_L>
event generate .t.f <Control_L>
@@ -6886,7 +6886,7 @@ proc testKey {window event type mods} {
global keyInfo numericKeysym
set keyInfo {}
set numericKeysym {}
- bind $window <KeyPress> {
+ bind $window <Key> {
set keyInfo [format "%K,0x%%X,0x%%X,%A" %N %k]
set numericKeysym %N
}
@@ -6960,8 +6960,8 @@ test bind-35.1 {Key events agree for entry widgets} -constraints {aqua} -setup {
test bind-35.2 {Can bind to function keys} -constraints {aqua} -body {
global keyInfo numericKeysym
- bind . <KeyPress> {}
- bind . <KeyPress> {
+ bind . <Key> {}
+ bind . <Key> {
lappend keyInfo %K
set numericKeysym %N
}
@@ -6979,7 +6979,7 @@ test bind-35.3 {Events agree for modifier keys} -constraints {aqua} -setup {
} -body {
global keyInfo numericalKeysym
set result {}
- bind . <KeyPress> {
+ bind . <Key> {
set keyInfo [format "%K,0x%%X,0x%%X,%A" %N %k]
set numericalKeysym [format "0x%x" %N]
}
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index 46daaa2..2e7ca4c 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -1338,7 +1338,7 @@ test imgPhoto-4.117 {ImgPhotoCmd data: list colorformat} -setup {
# This testcase fails with Tcl < 8.6.7, due to [25842c]
test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image
results in same image as orignial } -constraints {
- hasTeapotPhoto hasTranspTeapotPhoto needsTcl867
+ hasTeapotPhoto hasTranspTeapotPhoto needsTcl867
} -setup {
image create photo teapot -file $teapotPhotoFile
teapot copy teapot -from 50 60 70 80 -shrink
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index e03c50f..40a7b97 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -2329,13 +2329,13 @@ TkpInitializeMenuBindings(
"<KeyRelease-Alt_R>", "tk::WinMenuKey %W %N", 0);
(void) Tk_CreateBinding(interp, bindingTable, (ClientData) uid,
- "<Alt-KeyPress>", "tk::WinMenuKey %W %N", 0);
+ "<Alt-Key>", "tk::WinMenuKey %W %N", 0);
(void) Tk_CreateBinding(interp, bindingTable, (ClientData) uid,
"<Alt-KeyRelease>", "tk::WinMenuKey %W %N", 0);
(void) Tk_CreateBinding(interp, bindingTable, (ClientData) uid,
- "<KeyPress-F10>", "tk::WinMenuKey %W %N", 0);
+ "<Key-F10>", "tk::WinMenuKey %W %N", 0);
(void) Tk_CreateBinding(interp, bindingTable, (ClientData) uid,
"<KeyRelease-F10>", "tk::WinMenuKey %W %N", 0);