void lineTextFieldActivateCB( Widget w, XtPointer client_data, XtPointer call_data) { short line, rows, cols; int conv; char *cb, *buf, *linestr; Widget doc_w, line_w; XmTextPosition pos; cb = "lineTextFieldActivateCB"; doc_w = get_document_text(w, cb); line_w = get_widget_by_name(w, cb, "lineTextField"); XtVaGetValues(doc_w, XmNrows, &rows, XmNcolumns, &cols, NULL); buf = XmTextGetString(doc_w); linestr = XmTextFieldGetString(line_w); conv = atoi(linestr); if (conv > rows) { manage_widget(w, cb, "lineOutOfRangeMessageBox"); goto Cleanup; } line = (short) conv; pos = line_to_position(buf, line, rows, cols); XmTextSetInsertionPosition(doc_w, pos); Cleanup: XtFree(linestr); XtFree(buf); }
void saveCB( Widget w, XtPointer client_data, XtPointer call_data) { if (NULL == get_save_path()) manage_widget(w, "saveCB", "saveAsFileSelectionBox"); else save_file(w, "saveCB"); }
void BxManageCB( Widget w, XtPointer client_data, XtPointer call_data) { manage_widget(w, "BxManageCB", (char *) client_data); }