next up previous contents index
Next: Project Rotate Up: Projects Previous: Using or Adding a

``Unusing'' or Removing a Project

 

The counterparts to the methods "use" and "remove" are

   tex2html_wrap44022    tex2html_wrap44024
PROJECT * project
As explained in the previous section "unuse" calls the projects exit-method, which should be called "pname-exit" for project pname, removes all classes, methods and items of the project and "unuse"s the projects it depends upon when the project isn't used any more. "remove" is called when the project is deleted from the manager's list of added projects, it just calls "unuse".

The exit-method may be used to remove objects that were added by the init-method. There is no need to remove items that were given to the project by "add-item" or "add-item-for-opt", but the Surface project for example adds in its init-method display methods to the display method layer provided by project Time_Object

PROJECT *project_surface_init()
{
  PROJECT *self;
  METHLAYER *layer;

  self = (PROJECT *)START_METHOD(G_INSTANCE);
  ASSURE(self, "", END_METHOD(NULL));

  if(layer = (METHLAYER *)GRAPE(Time_Object, "get-display-layer")()) {
    GRAPE(layer, "add-button")("domain-disp",    "domain");
    GRAPE(layer, "add-button")("gauss-disp",     "gauss");
    GRAPE(layer, "add-button")("conjugate-disp", "conjugate");
    GRAPE(layer, "add-button")("associate-disp", "associate");
  }

  END_METHOD(self);
}
and it removes them from the layer in its exit-method:
PROJECT *project_surface_exit()
{
  PROJECT *self;
  METHLAYER *layer;

  self = (PROJECT *)START_METHOD(G_INSTANCE);
  ASSURE(self, "", END_METHOD(NULL));

  if(layer = (METHLAYER *)GRAPE(Time_Object, "get-display-layer")()) {
    GRAPE(layer, "remove-button")("domain-disp",    "domain");
    GRAPE(layer, "remove-button")("gauss-disp",     "gauss");
    GRAPE(layer, "remove-button")("conjugate-disp", "conjugate");
    GRAPE(layer, "remove-button")("associate-disp", "associate");
  }

  END_METHOD(self);
}

You can see what happens: start a GRAPE program and add the project Time_Object. Then go to the option menu and open the layer by clicking on the button ``geometry displays'', go back to the main menu and add project Explicit. Now the new buttons should have appeared, they disappear again when you delete the project Explicit.



SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.