Article # 283, added by Geoworks, historical record
| first | previous | index | next | last |

"Note" button doesn't work correctly.



Q. The "Note" button does nothing the first time it is hit.  The
   second time, it says "Unable to create the note.  The document may
   be a template, or it may be in use."

A. The support for the "Note" trigger isn't completely automatic.
   You have to add a NoteShellClass object to the app.  Also, your
   application is responsible for saving the NoteShell's data into
   the VM file.

   Here's what you should do:

   In your *.goc file:
   ===================
   1. Include the Geos header file that defines NoteShellClass.
      @include 

   2. Create a new subclass of NoteShellClass.

   3. Create an object of your new subclass of NoteShellClass.

   4. Make it a child of the GenApplication object.

   5. Add it to the following GCN lists:
      MGCNLT_ACTIVE_LIST (same as DocumentControl)
      GAGCNLT_STARTUP_LOAD_OPTIONS

   6. Intercept MSG_GEN_DISPLAY_CLOSE for your subclass of NoteShellClass:
      @method YourNoteShellClass, MSG_GEN_DISPLAY_CLOSE
      {
          /*
           * First, save away the NoteShell data into a VM file.
           */

          /*
           * Now, close the NoteShell
           */
          @send self::MSG_NOTE_SHELL_CLOSE_DISPLAY();
      }

   In your *.gp file:
   ==================
   1. Add "library notes" to load the notes library

   2. Export your new subclass of NoteShellClass