[Gambas-user] Cursor.X, Cursor.Y example
Bruce Steers
bsteers4 at gmail.com
Tue Aug 1 18:47:08 CEST 2023
On Tue, 1 Aug 2023, 13:45 Demosthenes Koptsis, <demosthenesk at gmail.com>
wrote:
> i had with older versions of Gambas3 the following code working fine...
>
> --------------------------------------------------
>
> ' Gambas class file
>
> Public Sub Form_MouseMove()
>
> Label1.Text = "Mouse X:" & Mouse.X
> Label2.Text = "Mouse Y:" & Mouse.Y
>
> End
>
> --------------------------------------------------
>
>
> Now for version 3.18.3 i tried the next one
>
>
> --------------------------------------------------
>
> ' Gambas class file
>
> Public Sub Form_MouseMove()
>
> Label1.Text = "Mouse X:" & Cursor.X
> Label2.Text = "Mouse Y:" & Cursor.Y
>
> End
>
> --------------------------------------------------
>
>
> But i get error "Cursor.X is not Static"
>
> How must i write the example code
>
> i want to show inside Labels the position of cursor X,Y
>
> Thanks Demosthenes!
>
>
Cursor class is more about a cursor image. You can see here it's
properties, http://gambaswiki.org/wiki/comp/gb.qt4/cursor
Cursor.X is for if you define a custom cursor image
http://gambaswiki.org/wiki/comp/gb.qt4/cursor/_new
then your custom cursor has it's hot-spot point
you need Mouse.Class like in the first code sample.
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230801/03073a4c/attachment.htm>
More information about the User
mailing list