diff options
author | fvogel <fvogelnew1@free.fr> | 2023-06-11 09:54:45 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-06-11 09:54:45 (GMT) |
commit | 2016fa2e7826a9cf3f293d4eb158630038c311e7 (patch) | |
tree | 0355ceccef234ba07dcf287903be3ea79e99abb2 | |
parent | b0fb3152f407a468ca7346ef9f5d33006c3ad881 (diff) | |
download | tk-2016fa2e7826a9cf3f293d4eb158630038c311e7.zip tk-2016fa2e7826a9cf3f293d4eb158630038c311e7.tar.gz tk-2016fa2e7826a9cf3f293d4eb158630038c311e7.tar.bz2 |
First quick and dirty implementation of 'ttk::style configure . -insertofftime'.
-rw-r--r-- | generic/ttk/ttkBlink.c | 7 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.c | 15 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.h | 2 |
3 files changed, 24 insertions, 0 deletions
diff --git a/generic/ttk/ttkBlink.c b/generic/ttk/ttkBlink.c index fc48af9..b1ba3f9 100644 --- a/generic/ttk/ttkBlink.c +++ b/generic/ttk/ttkBlink.c @@ -154,6 +154,13 @@ CursorEventProc(ClientData clientData, XEvent *eventPtr) } } +void TtkSetBlinkOffTime(WidgetCore* corePtr, int offTime) +{ + CursorManager* cm = GetCursorManager(corePtr->interp); + + cm->offTime = offTime; +} + /* * TtkBlinkCursor (main routine) -- * Arrange to blink the cursor on and off whenever the diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index d395caa..4f035bf 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -6,6 +6,7 @@ #include "tkInt.h" #include "ttkThemeInt.h" +#include "ttkThemeInt.h" #include "ttkWidget.h" /*------------------------------------------------------------------------ @@ -125,7 +126,21 @@ static void WidgetWorldChanged(ClientData clientData) { WidgetCore *corePtr = (WidgetCore *)clientData; (void)UpdateLayout(corePtr->interp, corePtr); + Ttk_Theme theme; + Ttk_Style style = NULL; + Tcl_Obj* result; + int offTime; + SizeChanged(corePtr); + + theme = Ttk_GetCurrentTheme(corePtr->interp); + style = Ttk_GetStyle(theme, "."); + result = Ttk_StyleDefault(style, "-insertofftime"); + if (result) { + Tcl_GetIntFromObj(corePtr->interp, result, &offTime); + TtkSetBlinkOffTime(corePtr, offTime); + } + TtkRedisplayWidget(corePtr); } diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 6f8d5b0..c3a1f6d 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -154,6 +154,8 @@ MODULE_SCOPE void TtkRedisplayWidget(WidgetCore *); MODULE_SCOPE void TtkResizeWidget(WidgetCore *); MODULE_SCOPE void TtkTrackElementState(WidgetCore *); + +MODULE_SCOPE void TtkSetBlinkOffTime(WidgetCore* corePtr, int offTime); MODULE_SCOPE void TtkBlinkCursor(WidgetCore *); /* |