Page 1 of 1

gadgetlist not updating?

Posted: Sat Nov 01, 2003 1:12 pm
by muab256
im writing a little monitor tool that sends a string to another pc
over network every 30 secs.

now i made the "receiver" hacing a window with listgadget.
every 30 secs it receives the string and should display it
by: AddGadgetItem (0,-1,x$)

my problem:

it does display the string _only_ if i move my mouse over the window
(just having it focused or having the mouse pointer on it is not enough),
if i dont move the mouse for eg 2 minutes, and then move over the
window, all "missing" strings are displayed at once...

what am i doin wrong?
what might be an alternative (where i can add a line in intervals and
also scroll?)

thx
muab

Posted: Sat Nov 01, 2003 5:48 pm
by Karbon
Can you post some code?

Are you sure that addgadgetitem() is being called when the string is received?

Posted: Sat Nov 01, 2003 5:57 pm
by muab256

Code: Select all

Case 2
 Buffer = AllocateMemory(0, 1000, 0) 
 ReceiveNetworkData(ClientID, Buffer, 1000)
 x$=PeekS(Buffer)
 
 AddGadgetItem (0,-1,x$)
thx for ur help =)

Posted: Sat Nov 01, 2003 7:10 pm
by GPI
Gadgets are updated on the next [wait]windowevent().

Posted: Sat Nov 01, 2003 7:24 pm
by muab256
yes, i have a delay of 500 msecs in the loop....
i would be satisfied even if it would update every few seconds,
but not only if u "draw cirles" with the mouse over the
window =(

Posted: Sat Nov 01, 2003 7:39 pm
by freak
Just insert a "While WindowEvent(): Wend" inside your loop.
But be aware, that then, every events from the user (button click etc...)
will be ignored while your loop runs.

Timo

Posted: Sat Nov 01, 2003 8:44 pm
by GPI
or try something like this:

Code: Select all

RedrawWindow_(GadgetID(1), 0, 0,#RDW_INTERNALPAINT|#RDW_INVALIDATE|#RDW_ALLCHILDREN)