Path: utzoo!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!uunet!mcsun!goya!colon!lmgc From: lmgc@gmv.es (Luis Mariano Gonzalez) Newsgroups: comp.windows.x Subject: Some questions about asciiString Widget. Message-ID: <1334@colon.gmv.es> Date: 30 Aug 89 09:55:39 GMT Reply-To: lmgc@colon.UUCP (Luis Mariano Gonzalez) Organization: Grupo de Mecanica del Vuelo, S.A. (GMV), Madrid, Spain Lines: 74 Hello - 1) I want to read the text from the widget using XtGetValues but it seems not to work. /* this is the way I create the Text Widget */ ..... char buf[100]; ..... n=0; XtSetArg(arg[n], XtNheight, 40); n++; XtSetArg(arg[n], XtNwidth, 200); n++; XtSetArg(arg[n], XtNtextOptions,editable); n++; XtSetArg(arg[n], XtNeditType,XttextEdit); n++; XtSetArg(arg[n], XtNstring, buf ); n++; w_text = XtCreateManagedWidget("text", asciiStringWidgetClass, form, arg, n); /* Here I fetch the text */ void Accep_text(widget,call_data,client_data) Widget widget; caddr_t call_data,client_data; { Arg arg[20]; unsigned int n; char buff[100]; n =0; XtSetArg(arg[n], XtNstring,buff) ; n++; XtGetValues(w_text,arg,n); n++; } ( I've also tried using - char * buff - instead of - buff[100]-, but the result was the same : null string). Do I miss something?. 2) I decided to use an asciiStringWidget to allow the user to edit one line text. The length of the string the user can introduce is given by the initial value of XtNstring.Thus if you initialize XtNstring to null the user won't be able to edit anything. ( Maybe dialog widget would be better in this case but I had problems with the initialization : length of text field was given by label lenght) Is it correct?. How can the user be allowed to edit one line without initializing the text? Another question: I'm using a widget form to implement a menu. Every menu item is a command widget. At any moment I want to make insensitive some command widgets. I wanted every event that occurs over these widgets to be send to the form widget. If the mouse button was released over an insensitive menu item I wanted to perform an specific operation. I select button_release for the form widgets, but when the button is released over an insensitive widget nothing occurs. Thanks in advance for any help! L.M. Gonzalez Ph. +54 1 234 30 04 Grupo de Mecanica del Vuelo, S.A. (GMV) Fax +54 1 233 32 50 Cristobal Bordiu, 35 Telex 48487 GMEV E E-28003 MADRID lmgonzalez@gmv.es SPAIN mcvax!gmv.es!lmgonzalez@uunet.uu.net uunet!mcvax!gmv.es!lmgonzalez