gadgetlist not updating?

Just starting out? Need help? Post your questions and find answers here.
muab256
User
User
Posts: 43
Joined: Mon Apr 28, 2003 4:57 pm

gadgetlist not updating?

Post 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
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Can you post some code?

Are you sure that addgadgetitem() is being called when the string is received?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
muab256
User
User
Posts: 43
Joined: Mon Apr 28, 2003 4:57 pm

Post 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 =)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Gadgets are updated on the next [wait]windowevent().
muab256
User
User
Posts: 43
Joined: Mon Apr 28, 2003 4:57 pm

Post 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 =(
freak
PureBasic Team
PureBasic Team
Posts: 5950
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

or try something like this:

Code: Select all

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