summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkWidget.c
diff options
context:
space:
mode:
authorjenglish <jenglish@noemail.net>2008-12-03 18:44:49 (GMT)
committerjenglish <jenglish@noemail.net>2008-12-03 18:44:49 (GMT)
commitc34b9a2a926ee1231805649aea1db7fbeca90b57 (patch)
treee50af7dbf34fa6fba912218b8b2ee694ef0f76e8 /generic/ttk/ttkWidget.c
parent1d32edc384187e8b7300b8c725fd855905e3ae42 (diff)
downloadtk-c34b9a2a926ee1231805649aea1db7fbeca90b57.zip
tk-c34b9a2a926ee1231805649aea1db7fbeca90b57.tar.gz
tk-c34b9a2a926ee1231805649aea1db7fbeca90b57.tar.bz2
Add new "hover" state
(patch from Pat Thoyts; needed to support proper visual feedback on Vista). FossilOrigin-Name: 8a64537bbfada17c4ac361b82ffc09430c80e9cf
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);