WideStudio Programming Guide

| WideStudio Programming Guide | WideStudio Index Table of contents

> ## How to create/delete the instances

> ### How to create the instance

> You can create the instance with the method: WSCbase::getNewInstance().

>       char*     class_name = "WSCvlabel";
>       char*     obj_name   = "vlabel001";
>       WSCbase*  parent  //The parent instance which has new instance.

>       //create a new instance.
>       WSCbase* object = WSCbase::getNewInstance(class_name,parent,obj_name);
>       object->initialize(); //initialize the instance.
>       object->clear();

>       object->setProperty(WSNx,100);
>       object->setProperty(WSNy,100);
>       object->setProperty(WSNwidth,100);
>       object->setProperty(WSNheight,100);
>       object->setVisible(True);

> You have to call initialize() to initialize before calling the other methods of the created instance.

> ### How to delete the instance

> You can destroy the instance with the global function: WSGFdestroyWindow().

>       //destroy the instance.
>       WSGFdestroyWindow(object);

> Do not call WSGFdestroyWindow() with the same instance twice, and do not access the destroyed instance, because it causes a fatal memory error.

Document Release 3.70 for WideStudio ver 3.70, Feb 2004

WideStudio documents index | Table of contents

Copyright(C) T. Hirabayashi, 2000-2004 | Last modified: Feb 25, 2004