| WideStudio Programming Guide | WideStudio Index Table of contents

> ## How to draw the instances

> You can use the following methods to draw the instances.

> To control drawing | Description
> setAbsoluteDraw(Boolean) | Sets the flag of forced drawing.
> draw() | draws if needs.
> redraw() | clears and draws
> cdraw() | draws the instance and its children.
> clear() | clears the instance.
> update() | draws if needs.

> ## How to update the instance

> Usually, it executes updating the instance at the end of the event procedures. If you want to update at once, you can it with the method: update().

>     def event_procedure(object):
>       # change a property.
>       object.setProperty("labelString","new text");
>       # updating.
>       object.update();
>       return
>     mpfc.WSGFfunctionRegister("event_procedure",event_procedure)

> The method: update() updates the instance, if it needs to reflect the change of the properties.

> ### How to draw the instance

> There are following cases to draw the instances.
> - Drawing compulsory
>   You make the flag of forced drawing "True" to draw compulsory, and call the method:draw(), because the method: draw() do not draw if it does not need.

>            object.setAbsoluteDraw(mpfc.True);
>            object.draw();

> - Drawing (ordinary)
>   Usually , we use the method: draw() to draw the instance. it has a good performance, because it do not draw if do not need.

>            object.draw();

> - Clearing the instance (no exposed event)
>   You can clear the instance with the method: clear(), and draw it with draw(). The method: clear() does not creates the exposed event, so, if the other instance which are overlapped exists, its area is invalidated. In such case, use redraw() method which creates the exposed event.

>            object.clear();
>            object.setAbsoluteDraw(mpfc.True);
>            object.draw();

> - Clearing the instance (creates the exposed event)
>   You can redraw the instance with the method: redraw(). it creates the exposed event so that the other overlapped instances are updated. it can make the performance worse if there are many instances.

>            object.redraw();

Document Release 3.70 for WideStudio ver 3.70, May 2004

WideStudio documents index | Table of contents

Copyright(C) WideStudio Development Team, 1999-2004 | Last modified: May 25, 2004