summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkWidget.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2008-12-03 18:44:49 (GMT)
committerjenglish <jenglish@flightlab.com>2008-12-03 18:44:49 (GMT)
commitbe03330f5858260351f40d4c3dffb0363d358ee5 (patch)
treee50af7dbf34fa6fba912218b8b2ee694ef0f76e8 /generic/ttk/ttkWidget.c
parentebcb804ce2070734ebccaae2d4fa9398bf0332cf (diff)
downloadtk-be03330f5858260351f40d4c3dffb0363d358ee5.zip
tk-be03330f5858260351f40d4c3dffb0363d358ee5.tar.gz
tk-be03330f5858260351f40d4c3dffb0363d358ee5.tar.bz2
Add new "hover" state
(patch from Pat Thoyts; needed to support proper visual feedback on Vista).
Diffstat (limited to 'generic/ttk/ttkWidget.c')
-rw-r--r--generic/ttk/ttkWidget.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index 9f8e0a4..820d3d8 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWidget.c,v 1.19 2008/11/16 17:14:16 jenglish Exp $
+/* $Id: ttkWidget.c,v 1.20 2008/12/03 18:44:50 jenglish Exp $
* Copyright (c) 2003, Joe English
*
* Core widget utilities.
@@ -281,6 +281,8 @@ static const unsigned CoreEventMask
| FocusChangeMask
| VirtualEventMask
| ActivateMask
+ | EnterWindowMask
+ | LeaveWindowMask
;
static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
@@ -324,6 +326,14 @@ static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
corePtr->state |= TTK_STATE_BACKGROUND;
TtkRedisplayWidget(corePtr);
break;
+ case LeaveNotify:
+ corePtr->state &= ~TTK_STATE_HOVER;
+ TtkRedisplayWidget(corePtr);
+ break;
+ case EnterNotify:
+ corePtr->state |= TTK_STATE_HOVER;
+ TtkRedisplayWidget(corePtr);
+ break;
case VirtualEvent:
if (!strcmp("ThemeChanged", ((XVirtualEvent *)(eventPtr))->name)) {
(void)UpdateLayout(corePtr->interp, corePtr);