Wide Studio Programmer's Guide

Wide Studio Home
Up to


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 same instance twice, and do not access the destroyed instace,because it causes a fatal memory error.
Document Release 3.0

For Use with Wide Studio Release 3.0, Summer 2002


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 2000-2002 Last modified: June 20, 2002