The object data system

SEAL supports the DRAG&DROP system, so it's important to make a standard copy and delete process. For this reason there are two functions: get_data() and set_data.

If you want to, f.e. get text from object, you set t_data.id = DAT_TEXT and call function get_data that return true if operation was succesfull, this function also sets t_data.rec to some text. If you want to set this text to an other object you call the set_data function.



Example:


     /* To get the selected text use: */
 
     t_data dat;
     dat.id    = DAT_TEXT;
     dat.style = DS_SELECTED;         /* Gets the selected text. */

     if (obj1->get_data(obj1, &dat))

         obj2->set_data(obj2, &dat);



     /* To get all the text use: */

     t_data dat;
     dat.id    = DAT_TEXT;
     dat.style = DS_ALL;              /* Gets all text from obj1. */

     if (obj1->get_data(obj1, &dat))

         obj2->set_data(obj2, &dat);


     /* To delete all the text use: */

     t_data dat;
     dat.id    = DAT_TEXT;
     dat.style = DS_DELETE+DS_ALL;    /* Deletes all text from obj2. */

     obj2->set_data(obj2, &dat);