Refresh Web Page

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Refresh Web Page

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
BarryG
Addict
Addict
Posts: 4118
Joined: Thu Apr 18, 2019 8:17 am

Re: Refresh Web Page

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Refresh Web Page

Post 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!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
BarryG
Addict
Addict
Posts: 4118
Joined: Thu Apr 18, 2019 8:17 am

Re: Refresh Web Page

Post by BarryG »

Glad to hear it! :)
Post Reply