version 1.2 | | version 1.3 |
---|
| | |
#include <Cnv.h> | | #include <Cnv.h> |
#include <Ansi.h> | | #include <Ansi.h> |
#include <Xaw.h> | | #include <Xaw.h> |
| | #include "debug.h" /* debug1 */ |
| | |
/********************************************************************** | | /********************************************************************** |
* prompt | | * prompt |
| | |
| | |
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); |
| | |
| | |
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)); |
} | | } |
| | |
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, |
| | |
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 ***/ |
| | |
} | | } |
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; |