From 7c5d00a56e62284cd53a21b45e7cff0e570903d3 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 23 Apr 2007 13:06:18 +0000 Subject: Fix the text cursor not displayed when the text is empty --- generic/tkZinc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'generic/tkZinc.c') diff --git a/generic/tkZinc.c b/generic/tkZinc.c index e7d6851..df3aeb6 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -336,7 +336,7 @@ static Tk_ConfigSpec config_specs[] = { {TK_CONFIG_BOOLEAN, "-confine", "confine", "Confine", "1", Tk_Offset(ZnWInfo, confine), 0, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", - "", Tk_Offset(ZnWInfo, cursor), TK_CONFIG_NULL_OK, NULL}, + "arrow", Tk_Offset(ZnWInfo, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_FONT, "-font", "font", "Font", "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*", Tk_Offset(ZnWInfo, font), 0, NULL}, @@ -7277,16 +7277,13 @@ Blink(ClientData client_data) } if (wi->text_info.cursor_on) { wi->text_info.cursor_on = 0; - wi->blink_handler = Tcl_CreateTimerHandler(wi->insert_off_time, - Blink, client_data); + wi->blink_handler = Tcl_CreateTimerHandler(wi->insert_off_time, Blink, client_data); } else { wi->text_info.cursor_on = 1; - wi->blink_handler = Tcl_CreateTimerHandler(wi->insert_on_time, - Blink, client_data); + wi->blink_handler = Tcl_CreateTimerHandler(wi->insert_on_time, Blink, client_data); } - if ((wi->focus_item != ZN_NO_ITEM) && - (wi->focus_item->class->Cursor != NULL)) { + if ((wi->focus_item != ZN_NO_ITEM) && (wi->focus_item->class->Cursor != NULL)) { ZnITEM.Invalidate(wi->focus_item, ZN_DRAW_FLAG); } } @@ -7300,8 +7297,7 @@ Focus(ZnWInfo *wi, SET(wi->flags, ZN_GOT_FOCUS); wi->text_info.cursor_on = 1; if (wi->insert_off_time != 0) { - wi->blink_handler = Tcl_CreateTimerHandler(wi->insert_off_time, - Blink, (ClientData) wi); + wi->blink_handler = Tcl_CreateTimerHandler(wi->insert_off_time, Blink, (ClientData) wi); } } else { -- cgit v1.1