new to event processing, need to force refre sh?

Hmmm... Well Update() appeared to work, but when the number of messages is increased to hundreds, it is apparent that what is really happening is that all the messages are recieved and queued. After the last one is recieved, they are all displayed and the xwHtmlWindow is updated between each one.

What I really need is to update the wxHtmlWindow after each message *as it is recieved*, without them being queued up.

Anybody know why this is happening, given that I am using ProcessEvent() instead of AddPendingEvent() in the CORBA server thread?

Thanks,

Bruce

···

-----Original Message-----
From: brucedickey [mailto:brucedickey@micron.com]
Sent: Tuesday, March 04, 2003 9:34 AM
To: 'wxPython-users@lists.wxwindows.org'
Subject: RE: [wxPython-users] new to event processing, need to force
refre sh?

Found that Update() works. Found on a Google:

wxWindows 2 Change Log
----------------------

snip! snip!

OTHER CHANGES

2.3.3
-----

snip! snip!

wxGTK:

snip! snip!

- new behaviour for wxWindow::Refresh() as it now produces a delayed refresh.
  Call the new wxWindow::Update() to force an immediate update

But I'm on WindowsNT (not using GTK) so go figure??? Anybody?

Bruce

-----Original Message-----
From: brucedickey [mailto:brucedickey@micron.com]
Sent: Tuesday, March 04, 2003 9:06 AM
To: 'wxPython-users@lists.wxwindows.org'
Subject: [wxPython-users] new to event processing, need to force
refresh?

Hi,

I have a client-server system using CORBA. The GUI is the server. The client sends CORBA messages which I then send on to the GUI via ProcessEvent() (had tried AddPendingEvent() first). I want to display data from the CORBA message in a wxHtmlWindow. I'm using SetPage() for that. After recieving 16 CORBA messages, only the last one is displayed. These happen quite rapidly, probably on the order of 1 milisecond apart. These messages "two-way"; each must return before the client can send another. This is for a real-time control application. I _do_ want each message displayed before the next CORBA message is allowed to be sent (in one particular mode), even though it delays the client in the process. I have tried Refresh() and OnPaint() against the wxHtmlWindow, but these no not help.

How can I force the wxHtmlWindow to be updated for each message rather than only for the last one?

Incidently, the CORBA server and the GUI are in different threads (I'm using TAO, the ACE ORB). When a CORBA message is recieved by the server, it must be dispatched to the GUI. It looks as if even though the CORBA messages are two-way, the handler in the sever (in a separate thread on the GUI side) returns before the event is processed in the GUI (even though ProcessEvent() is used), allowing the client side to send another message.

Any ideas?

Thank you,

Bruce

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

brucedickey wrote:

Hmmm... Well Update() appeared to work, but when the number of
messages is increased to hundreds, it is apparent that what is really
happening is that all the messages are recieved and queued. After the
last one is recieved, they are all displayed and the xwHtmlWindow is
updated between each one.

What I really need is to update the wxHtmlWindow after each message
*as it is recieved*, without them being queued up.

Anybody know why this is happening, given that I am using
ProcessEvent() instead of AddPendingEvent() in the CORBA server
thread?

If ProcessEvent is called from the non-main thread then it redirects the call to AddPendingEvent. (wxPostEvent also uses AddPendingEvent.) Those events are processed the next time there is an EVT_IDLE event.

There is no simple way to force an event to happen before control returns to the caller in a non-gui thread. The only way I can think of to ensure that your event has been processed before returning from the CORBA method call is block the thread and wait for some signal from the event handler. Perhaps using a threading.Event will do it for you.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!