Didier9 Well-Known Member Licensed User Longtime User Jun 26, 2019 #1 Some tasks take a while and I would like to change the cursor to the hourglass cursor so the user knows something is going on. Not sure how to do that. TIA
Some tasks take a while and I would like to change the cursor to the hourglass cursor so the user knows something is going on. Not sure how to do that. TIA
DonManfred Expert Licensed User Longtime User Jun 26, 2019 #2 Check this: Maybe of help https://www.b4x.com/android/forum/threads/mousecursor-solved.55000/#post-345967 PD: I found it using the forumsearch which is working! Upvote 0
Check this: Maybe of help https://www.b4x.com/android/forum/threads/mousecursor-solved.55000/#post-345967 PD: I found it using the forumsearch which is working!
Didier9 Well-Known Member Licensed User Longtime User Jun 26, 2019 #3 Thank you Don, I think it is getting close, but in the context of the proposed code: Code: Copy Dim cursor As JavaObject cursor.InitializeStatic("javafx.scene.Cursor") Dim joObj as JavaObject = ap joObj.RunMethod("setCursor", Array(cursor.GetField("E_RESIZE"))) what is "ap"? PS: I did use Search but probably did not use the proper keywords and did not see that post... Upvote 0
Thank you Don, I think it is getting close, but in the context of the proposed code: Code: Copy Dim cursor As JavaObject cursor.InitializeStatic("javafx.scene.Cursor") Dim joObj as JavaObject = ap joObj.RunMethod("setCursor", Array(cursor.GetField("E_RESIZE"))) what is "ap"? PS: I did use Search but probably did not use the proper keywords and did not see that post...
Erel B4X founder Staff member Licensed User Longtime User Jun 26, 2019 #4 Code: Copy MainForm.RootPane.MouseCursor = fx.Cursors.WAIT Upvote 0
Didier9 Well-Known Member Licensed User Longtime User Jun 26, 2019 #5 Thank you Erel, that was too easy Upvote 0
Didier9 Well-Known Member Licensed User Longtime User Jun 26, 2019 #6 Turns out it is working but not necessarily as you would expect. If the cursor is changed and changed back to default within a function block, the cursor on screen will not actually change. Simply inserting Sleep(0) after the first command did not seem enough to allow java to actually change the cursor but maybe because the delay between the two commands is too short at the moment. Is there another way to force the screen to be redrawn with the new cursor? PS: I changed the Sleep(0) to Sleep(500) and definitely the cursor changes I call this victory! Upvote 0
Turns out it is working but not necessarily as you would expect. If the cursor is changed and changed back to default within a function block, the cursor on screen will not actually change. Simply inserting Sleep(0) after the first command did not seem enough to allow java to actually change the cursor but maybe because the delay between the two commands is too short at the moment. Is there another way to force the screen to be redrawn with the new cursor? PS: I changed the Sleep(0) to Sleep(500) and definitely the cursor changes I call this victory!