PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV Mobile 2024 → Updating a control from a thread in Android.
Updating a control from a thread in Android.
Iniciado por Colin, 05,sep. 2013 08:51 - 4 respuestas
Miembro registrado
13 mensajes
Publicado el 05,septiembre 2013 - 08:51
I have a thread that monitors a GPIO. I want to update a control on the thread parent window when the GPIO changes state.

I get an error that advises that the thread cannot change the window.

PostMessage does not appear to be supported for Android, so how do I effect the update of the main window from a thread?

--
Colin
Publicado el 05,septiembre 2013 - 15:00
Hi Colin

you could try adding a timer on the main thread=window. This timer
checks if the value of something in memory has changed (updated by the
secondary thread) and does the updating

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 9/5/2013 12:51 AM, Colin wrote:
I have a thread that monitors a GPIO. I want to update a control on the
thread parent window when the GPIO changes state.

I get an error that advises that the thread cannot change the window.

PostMessage does not appear to be supported for Android, so how do I
effect the update of the main window from a thread?

--
Colin
Publicado el 08,septiembre 2013 - 01:17
Does the suggestion below work ok?
I'm getting the same problem.
I'm using a persistent thread to deal with GPS and I need to refresh some info in the mais window when it's opened.
I have been tryied to use a main window's procedure which uses timer but Windev mobile returns to me a message "tError:The automatic execution of procedures is not available in Android in this version.
WIN_MAIN.PROCEDURE._Show_Information, Local Procedure, line 0, column 0"

Any ideas?
Publicado el 09,septiembre 2013 - 20:13
Hi Marco

the idea is to use the FUNCTION timer in wlanguage

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 9/7/2013 5:17 PM, Marco Antonio Machado wrote:
Does the suggestion below work ok?
I'm getting the same problem.
I'm using a persistent thread to deal with GPS and I need to refresh
some info in the mais window when it's opened.
I have been tryied to use a main window's procedure which uses timer but
Windev mobile returns to me a message "tError:The automatic execution of
procedures is not available in Android in this version.
WIN_MAIN.PROCEDURE._Show_Information, Local Procedure, line 0, column 0"

Any ideas?
Miembro registrado
13 mensajes
Publicado el 13,septiembre 2013 - 06:28
Hi All,

@Fabrice, that is what I almost did, except I used the timer to run a procedure - Your solution of checking a variable is much nicer and more efficient

Thank you.

--
Colin