Lisp HUG Maillist Archive

Hiding the cursor

Hi everybody,

is there a simple way to completely hide the mouse cursor temporarily
with CAPI?  My current understanding is that I'd have to create a
"void" (transparent?) cursor, store it in a file, load this file using
LOAD-CURSOR and finally enable it using (SETF SIMPLE-PANE-CURSOR).  Is
there a more elegant way to do this?

A Windows-specific function would be fine for now.  I tried
WIN32:SET-CURSOR with FLI:*NULL-POINTER* but that doesn't seem to have
any effect.

Thanks,
Edi.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Hiding the cursor

Hmm, it seems to be more complicated, actually.  Even if I use
LOAD-CURSOR with a blank cursor, the mouse cursor doesn't vanish.  I
think the problem is that my application uses
MP:WAIT-PROCESSING-EVENTS on purpose and during this waiting period I
want the mouse cursor to disappear.  But apparently something inside
the bowels of CAPI and/or Win32 causes the hourglass cursor to be
shown when MP:WAIT-PROCESSING-EVENTS is called.

Any ideas?


On Fri, Dec 12, 2014 at 5:56 PM, Edi Weitz <edi@weitz.de> wrote:
> Hi everybody,
>
> is there a simple way to completely hide the mouse cursor temporarily
> with CAPI?  My current understanding is that I'd have to create a
> "void" (transparent?) cursor, store it in a file, load this file using
> LOAD-CURSOR and finally enable it using (SETF SIMPLE-PANE-CURSOR).  Is
> there a more elegant way to do this?
>
> A Windows-specific function would be fine for now.  I tried
> WIN32:SET-CURSOR with FLI:*NULL-POINTER* but that doesn't seem to have
> any effect.
>
> Thanks,
> Edi.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Hiding the cursor

Sorry for the noise, but - at least on Windows -
INTERFACE-OVERRIDE-CURSOR /has/ an effect (as opposed to
SIMPLE-PANE-CURSOR) during the waiting phase.  The problem with this
approach is that it seems one cannot use loaded cursors - only the
pre-configured keywords.  Hmm...

On Sat, Dec 13, 2014 at 10:09 AM, Edi Weitz <edi@weitz.de> wrote:
> Hmm, it seems to be more complicated, actually.  Even if I use
> LOAD-CURSOR with a blank cursor, the mouse cursor doesn't vanish.  I
> think the problem is that my application uses
> MP:WAIT-PROCESSING-EVENTS on purpose and during this waiting period I
> want the mouse cursor to disappear.  But apparently something inside
> the bowels of CAPI and/or Win32 causes the hourglass cursor to be
> shown when MP:WAIT-PROCESSING-EVENTS is called.
>
> Any ideas?
>
>
> On Fri, Dec 12, 2014 at 5:56 PM, Edi Weitz <edi@weitz.de> wrote:
>> Hi everybody,
>>
>> is there a simple way to completely hide the mouse cursor temporarily
>> with CAPI?  My current understanding is that I'd have to create a
>> "void" (transparent?) cursor, store it in a file, load this file using
>> LOAD-CURSOR and finally enable it using (SETF SIMPLE-PANE-CURSOR).  Is
>> there a more elegant way to do this?
>>
>> A Windows-specific function would be fine for now.  I tried
>> WIN32:SET-CURSOR with FLI:*NULL-POINTER* but that doesn't seem to have
>> any effect.
>>
>> Thanks,
>> Edi.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Hiding the cursor

Hi Andreas,

Works here as well.  Thanks a lot!

Cheers,
Edi.




On Sat, Dec 13, 2014 at 6:43 PM, Andreas Hinze <ahz@snafu.de> wrote:
> Am 13.12.2014 17:45, schrieb Andreas Hinze:
>>
>> Hi Eddi
>>
>> If a Win32 specific solution will be sufficient then maybe ShowCursor() is
>> the way to go ?
>>
>>
>> http://msdn.microsoft.com/en-us/library/windows/desktop/ms648396%28v=vs.85%29.aspx
>>
>> Regards
>> Andreas
>
>
> BTW: Did i always want to play around with FFI on LWW.
> So, here we are. LWW6.0 on Win7/64. And it works ;-)
>
> Regards Andreas
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Begin of code
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (defpackage "MY-PACKAGE"
>     (:add-use-defaults t)
>     (:use "CAPI"))
>
> (in-package "MY-PACKAGE")
>
> ;; Display or hide the cursor.
> ;; If bShow is TRUE, the display count is incremented by one. If bShow is
> FALSE, the display count is decremented by one.
> (fli:define-foreign-function (show-cursor "ShowCursor")
>   ((bShow :boolean))
>   :result-type :boolean)
>
> (capi:contain
>  (make-instance
>   'capi:output-pane
>   :title "Select this window and the cursor vanishes (in this window)"
>   :focus-callback
>   #'(lambda (pane hasfocus_p)
>       (if hasfocus_p
>           (progn
>             (format t "Pane ~a selected. Cursor disabled~%" pane)
>             (show-cursor nil))
>        (progn
>             (format t "Pane ~a deselected. Cursor enabled~%" pane)
>             (show-cursor t))))))
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; End of code
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


RE: Hiding the cursor

Please remove this email address from list serve.







Jerri Freeman, CCS-P, CPC-I, CPC, CPC-P | Content Analyst
AHIMA Approved ICD-10-CM/PCS Trainer
AAPC Approved ICD-10-CM Trainer
Verisk Health - Payment Accuracy
PHONE919.313.1671MOBILE336.309.2465FAX919.313.1698

WEBSITE | VCARD | MAP | EMAIL



This email and its attachments may contain privileged, confidential, and/or protected health information. If you are not the intended recipient please notify me directly and permanently delete all forms of this email.


-----Original Message-----
From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Edi Weitz
Sent: Sunday, December 14, 2014 4:11 PM
To: Andreas Hinze
Cc: Lisp Hug Lispworks
Subject: Re: Hiding the cursor


Hi Andreas,

Works here as well.  Thanks a lot!

Cheers,
Edi.




On Sat, Dec 13, 2014 at 6:43 PM, Andreas Hinze <ahz@snafu.de> wrote:
> Am 13.12.2014 17:45, schrieb Andreas Hinze:
>>
>> Hi Eddi
>>
>> If a Win32 specific solution will be sufficient then maybe
>> ShowCursor() is the way to go ?
>>
>>
>> http://msdn.microsoft.com/en-us/library/windows/desktop/ms648396%28v=
>> vs.85%29.aspx
>>
>> Regards
>> Andreas
>
>
> BTW: Did i always want to play around with FFI on LWW.
> So, here we are. LWW6.0 on Win7/64. And it works ;-)
>
> Regards Andreas
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Begin of code
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (defpackage "MY-PACKAGE"
>     (:add-use-defaults t)
>     (:use "CAPI"))
>
> (in-package "MY-PACKAGE")
>
> ;; Display or hide the cursor.
> ;; If bShow is TRUE, the display count is incremented by one. If bShow
> is FALSE, the display count is decremented by one.
> (fli:define-foreign-function (show-cursor "ShowCursor")
>   ((bShow :boolean))
>   :result-type :boolean)
>
> (capi:contain
>  (make-instance
>   'capi:output-pane
>   :title "Select this window and the cursor vanishes (in this window)"
>   :focus-callback
>   #'(lambda (pane hasfocus_p)
>       (if hasfocus_p
>           (progn
>             (format t "Pane ~a selected. Cursor disabled~%" pane)
>             (show-cursor nil))
>        (progn
>             (format t "Pane ~a deselected. Cursor enabled~%" pane)
>             (show-cursor t))))))
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; End of code
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users lisp-hug@lispworks.com http://www.lispworks.com/support/lisp-hug.html


________________________________

This email is intended solely for the recipient. It may contain privileged, proprietary or confidential information or material. If you are not the intended recipient, please delete this email and any attachments and notify the sender of the error.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:33 UTC