Page 1 of 1

Refresh Web Page

Posted: Tue Mar 19, 2024 4:27 am
by IdeasVacuum
This function is not working from a thread:

Code: Select all

SetGadgetState(#WebGadget, #PB_Web_Refresh)
Works OK outside of the thread (via a button event for example) but I really need it to work from the thread - is that simply a no, cannot be done, or is it a bug or is there a way?

Re: Refresh Web Page

Posted: Tue Mar 19, 2024 4:50 am
by BarryG
IdeasVacuum wrote: Tue Mar 19, 2024 4:27 amWorks OK outside of the thread (via a button event for example)
I'd use PostEvent() from inside the thread then, to simulate the button event.

From what I've always read here, you're not supposed to update gadgets from inside a thread.

Re: Refresh Web Page

Posted: Tue Mar 19, 2024 5:43 am
by IdeasVacuum
Hi Barry

I have another thread to display the time in a Text Box, that works fine.............

Thanks for the PostEvent() tip, haven't used that before but sounds promising 8)

Edit: PostEvent() solved the problem!

Re: Refresh Web Page

Posted: Tue Mar 19, 2024 6:48 am
by BarryG
Glad to hear it! :)