Page 1 of 1

HTML - Image draw

Posted: Fri Jun 10, 2005 14:48
by parul
Hi All,

We are creating HTML Viewer widget using CEGUI. This is the sequence of activities that we nned follow for drawing an Image:

a) If Image tag is found, send a message to Container Application.
c) If Image is with container, it sets it back to the widget by calling a function and widget can draw the image

Now Widget needs to keep check on time in which image should be set by container application. For implementing this we want to wait for some time, till we get the response for image from container application.

Can any body please suggest how do i achieve this functionality.

regards
parul

Re: HTML - Image draw

Posted: Sat Jun 11, 2005 14:28
by DrPain
I'd suggest running the widget from its own thread, and just Sleep'ing while waiting. Of course, you'll have to have some signal to indicate when it's OK to draw. Perhaps I'd have the data gathering done in this seperate thread, and have a Draw routine for the widget that displays the data it's already received, to be called from your normal Render routine.

Dave

Re: HTML - Image draw

Posted: Sun Jun 12, 2005 05:58
by parul
Hi,

Thanks for reply.

Can you please tell me how i can implement threads in CEGUI system.

Regards,
Parul

Re: HTML - Image draw

Posted: Sun Jun 12, 2005 21:28
by DrPain
I would think the HTML portion of your code (the sending and getting of data) would be seperate from the GUI. I would create a class (if using C++) to handle the web page, and within that class, create a thread to handle the IO. Also as part of that class, but seperate from the thread, create a Render routine that draws the current data set. Be sure to put some kind of mutex around the data to prevent drawing while updating.

Dave