HTML - Image draw

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
parul
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Mon Feb 14, 2005 05:11

HTML - Image draw

Postby parul » Fri Jun 10, 2005 14:48

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

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: HTML - Image draw

Postby DrPain » Sat Jun 11, 2005 14:28

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

User avatar
parul
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Mon Feb 14, 2005 05:11

Re: HTML - Image draw

Postby parul » Sun Jun 12, 2005 05:58

Hi,

Thanks for reply.

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

Regards,
Parul

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: HTML - Image draw

Postby DrPain » Sun Jun 12, 2005 21:28

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


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 12 guests