Tk Source Code

View Ticket
Login
2001-04-25
05:56 Closed ticket [219919ffff]: Support for custom cursors on Win32 plus 3 other changes artifact: acff4817d9 user: dgp
05:55 Open ticket [219919ffff]. artifact: bcaacde9f1 user: dgp
2000-11-01
01:43 Closed ticket [219919ffff]. artifact: a249e6568d user: welch
2000-10-31
18:43 New ticket [219919ffff]. artifact: 75d8443972 user: welch

Ticket UUID: 219919
Title: Support for custom cursors on Win32
Type: RFE Version: None
Submitter: welch Created on: 2000-10-31 18:43:47
Subsystem: 31. Cursor Names Assigned To: nobody
Priority: 1 Zero Severity:
Status: Closed Last Modified: 2001-04-25 05:56:17
Resolution: Duplicate Closed By: dgp
    Closed on: 2001-04-24 22:56:17
Description:
OriginalBugID: 1252 RFE
Version: 8.0.4
SubmitDate: '1999-02-22'
LastModified: '1999-08-31'
Severity: LOW
Status: Closed
Submitter: welch
ChangedBy: hobbs
RelatedBugIDs: 1350
OS: Windows NT
OSVersion: 4, SP3
Machine: X86
ClosedDate: '1999-08-31'


Name:

David Ascher


Extensions:

None


CustomShell:

Patch to tkWinCursor, no backwards-incompatible changes.  Only added new functionality on Win32


ReproducibleScript:

As documented in the Tk doc, custom cursors don't work on Win32.


ObservedBehavior:

Custom cursors don't work on Win32 -- one is limited to the system cursors.


DesiredBehavior:

Behavior similar on win32 as on X.


Patch:

--- tkWinCursor.c.oldWed Jan 13 13:28:21 1999

+++ tkWinCursor.c.newWed Jan 13 13:51:26 1999

@@ -109,6 +109,29 @@

 cursorPtr->winCursor = LoadCursor(Tk_GetHINSTANCE(), string);

 cursorPtr->system = 0;

     }

+#ifdef WINDOWS_CURSOR_FILES

+    if (string[0] == '@') {

+    int argc;

+    char **argv = NULL;

+    if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {

+    return NULL;

+    }

+    if ((argc != 1) || (argv[0][0] != '@')) {

+    ckfree((char *)cursorPtr);

+    Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"",

+     (char *) NULL);

+    return NULL;

+    }

+    if (Tcl_IsSafe(interp)) {

+    Tcl_AppendResult(interp, "can't get cursor from a file in",

+     " a safe interpreter", (char *) NULL);

+    ckfree((char *)cursorPtr);

+    return NULL;

+    }

+    cursorPtr->winCursor = LoadCursorFromFile(&(argv[0][1]));

+    cursorPtr->system = 0;

+    }

+#endif

     if (cursorPtr->winCursor == NULL) {

 ckfree((char *)cursorPtr);

 Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"",


PatchFiles:

tkWinCursor.c




This adds support for .CUR and .ANI cursors.

I believe I've submitted this patch before, but it never showed up anywhere, nor did I get an ack.  Please acknowledge receipt.