Index: doc/ttk_style.n ================================================================== --- doc/ttk_style.n +++ doc/ttk_style.n @@ -182,19 +182,21 @@ .RS Specifies a non-negative integer value indicating the number of milliseconds the insertion cursor should remain .QW off in each blink cycle. If this option is zero then the cursor does not blink: -it is on all the time. +it is on all the time. Defaults to 300 ms, unless overriden with a +\fBRESOURCE_MANAGER\fR property or \fB.Xdefaults\fR file. .RE .PP \fB\-insertontime\fP \fIamount\fP .RS Specifies a non-negative integer value indicating the number of milliseconds the insertion cursor should remain .QW on -in each blink cycle. +in each blink cycle. Defaults to 600 ms, unless overriden with a +\fBRESOURCE_MANAGER\fR property or \fB.Xdefaults\fR file. .RE .SH "SEE ALSO" ttk::intro(n), ttk::widget(n), photo(n), ttk_image(n) .SH KEYWORDS style, theme, appearance Index: generic/ttk/ttkBlink.c ================================================================== --- generic/ttk/ttkBlink.c +++ generic/ttk/ttkBlink.c @@ -48,17 +48,41 @@ */ static CursorManager *GetCursorManager(Tcl_Interp *interp) { static const char *cm_key = "ttk::CursorManager"; CursorManager *cm = (CursorManager *)Tcl_GetAssocData(interp, cm_key,0); + Tk_Window window; + Tk_Uid value; + int intValue; if (!cm) { cm = (CursorManager *)ckalloc(sizeof(*cm)); cm->timer = 0; cm->owner = 0; cm->onTime = DEF_CURSOR_ON_TIME; cm->offTime = DEF_CURSOR_OFF_TIME; + + /* Override on and off default times with values obtained from + * the option database (if such values are specified). + */ + + window = Tk_MainWindow(interp); + if (window) { + value = Tk_GetOption(window, "insertOnTime", "OnTime"); + if (value) { + if (Tcl_GetInt(interp, value, &intValue) == TCL_OK) { + cm->onTime = intValue; + } + } + value = Tk_GetOption(window, "insertOffTime", "OffTime"); + if (value) { + if (Tcl_GetInt(interp, value, &intValue) == TCL_OK) { + cm->offTime = intValue; + } + } + } + Tcl_SetAssocData(interp, cm_key, CursorManagerDeleteProc, cm); } return cm; }