Difference for crossedit/Cnv/CnvPrompt.c from version 1.2 to 1.3


version 1.2 version 1.3
Line 1
 
Line 1
 #include <Cnv.h>  #include <Cnv.h>
 #include <Ansi.h>  #include <Ansi.h>
 #include <Xaw.h>  #include <Xaw.h>
   #include "debug.h" /* debug1 */
   
 /**********************************************************************  /**********************************************************************
  * prompt   * prompt
Line 8
 
Line 9
   
 static int CnvPromptSelect = 0;  static int CnvPromptSelect = 0;
 static int CnvPromptActionFlag = 0;  static int CnvPromptActionFlag = 0;
 static char *CnvPromptString;  static char CnvPromptString[CnvPromptMax+1];
 static Widget CnvPromptWidgetText;  static Widget CnvPromptWidgetText;
 static void CnvPromptCb (Widget w, XtPointer client, XtPointer call);  static void CnvPromptCb (Widget w, XtPointer client, XtPointer call);
   
Line 33
 
Line 34
 static void CnvPromptCb (Widget w, XtPointer client, XtPointer call)  static void CnvPromptCb (Widget w, XtPointer client, XtPointer call)
 {  {
     CnvPromptSelect = (int) client; /* set cardinal */      CnvPromptSelect = (int) client; /* set cardinal */
     XtVaGetValues (CnvPromptWidgetText, XtNstring, &CnvPromptString, NULL);      char *t;
       XtVaGetValues(CnvPromptWidgetText, XtNstring, &t, NULL);
      
       snprintf(CnvPromptString, sizeof(CnvPromptString), "%s", t);
   
     XtDestroyWidget (CnvGetShell (w));      XtDestroyWidget (CnvGetShell (w));
 }  }
Line 45
 
Line 49
     int i;      int i;
     String str;      String str;
   
       CnvPromptString[0] = '\0';
   
     if (!CnvPromptActionFlag) {      if (!CnvPromptActionFlag) {
  XtAppContext a = XtWidgetToApplicationContext (cnv->shell);   XtAppContext a = XtWidgetToApplicationContext (cnv->shell);
  XtAppAddActions (a,CnvPromptActionTable,    XtAppAddActions (a,CnvPromptActionTable,
Line 87
 
Line 93
  XtNwidth,336,   XtNwidth,336,
  NULL);   NULL);
          
       /* Put the cursor at the end of the line. */
       XtVaSetValues(CnvPromptWidgetText,
           XtNinsertPosition, strlen(def),
           NULL);
      
     XtInstallAllAccelerators(cont,cont);      XtInstallAllAccelerators(cont,cont);
          
     /*** button-list ***/      /*** button-list ***/
Line 108
 
Line 119
     }      }
     i = CnvPromptSelect;      i = CnvPromptSelect;
     CnvPromptSelect = 0;      CnvPromptSelect = 0;
      
       debug1("CnvPrompt '%s'\n", CnvPromptString);
     strncpy(ans,CnvPromptString,CnvPromptMax);      strncpy(ans,CnvPromptString,CnvPromptMax);
     ans[CnvPromptMax] = '\0';      ans[CnvPromptMax] = '\0';
     return i;      return i;


Legend:
line(s) removed in v.1.2 
line(s) changed
 line(s) added in v.1.3

File made using version 1.98 of cvs2html by leaf at 2011-07-21 19:52