Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


LUA Force Form Update (Mouse)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
rphii
How do I cheat?
Reputation: 0

Joined: 19 Aug 2022
Posts: 6

PostPosted: Thu Oct 26, 2023 6:06 pm    Post subject: LUA Force Form Update (Mouse) Reply with quote

Hello!

Suppose I have the following code.

Code:

function Form_ButtonSaveClick(sender)
  Form_ButtonSave.Cursor = crHourGlass
  -- ... long process ...
  Form_ButtonSave.Cursor = crDefault
end


Now, I'd like to have the style of the cursor updated before the long process is over, and not when the function finished executing. Is there a way to achieve that?

I tried using different form things and show/hide them instead, but to no surprise, that also didn't work. I assume there might be some function I just can't find that updates stuff.

Thanks
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4699

PostPosted: Thu Oct 26, 2023 9:57 pm    Post subject: Reply with quote

rphii wrote:
I'd like to have the style of the cursor updated before the long process is over, and not when the function finished executing.
This is ambiguous. Does the cursor not change to crHourGlass before it starts? Do you want it to change back to crDefault before or after the "long process" is over?

Whatever you're trying to do depends entirely on the "long process" you omitted. If it's asynchronous (e.g. createTimer, createThread, memscan.OnScanDone, etc.), then change the cursor back to crDefault at the end of the asynchronous code (remember to only access the GUI from the main thread). If it's synchronous, you should probably make it asynchronous to avoid freezing the GUI.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites