Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!ucbcad!ucbvax!DECWRL.DEC.COM!price From: price@DECWRL.DEC.COM Newsgroups: comp.windows.x Subject: Re: X toolkit Message-ID: <8711102030.AA25250@eros.dec.com> Date: Tue, 10-Nov-87 17:08:19 EST Article-I.D.: eros.8711102030.AA25250 Posted: Tue Nov 10 17:08:19 1987 Date-Received: Fri, 13-Nov-87 00:09:17 EST References: <970.8711092045@latlog.co.uk> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 75 Julian Payne asks several questions: 1) How do you register ordinary windows (i.e. not widgets) with the dispatcher. If this is not possible then the XtDispatch routine should indicate whether or not it used the event? The current toolkit requires a widget to be registered with the toolkit. This means that your window must be packaged ( "wrapped" ) in a widget. The current toolkit does not include a "Window Widget". I expect that this will appear shortly, since there has already been xpert traffic discussing the need for such a beast. In the mean time, you must write a widget to contain you window. The widget doesn't really have to do much else; it can be a subclass of the Core widget, and you can use the widget handle to externally register event handlers for expediency. 2) Can more than one function be called automatically by the dispatcher for the same widget (or window) and the same event mask? yes. 3) I have got the text widget to work but I have had some problems understanding how it should be used: a) When you pass a string to XtTextStringCreate does it use the string as a buffer or does it copy the string to its own buffer, who is in charge of checking that the buffer does not overflow and dealing with it when the end of the buffer is reached? It uses the string as a buffer. It does not copy it. This is probably not a good idea, but that's the way it currently works. The Text widget is *supposed* to handle overflow checking, but it currently doesn't. This is not a feature. b) What I want to do is have a XttextAppend widget where I can send it a prompt and then type commands in which I can send to the application every time I get a newline. The text widget is wonderful for appending text and moving through the text (I love the emacs-type functionality) but it seems very hard to get information back about what I typed. At the moment I have to check key press events and maintain my own buffer, I can't read the data itself because I need to distinguish between what the user typed and what the application printed. You should be able to achieve this functionality by using the translation manager. At least that is the intent. Unfortunately, the current text widget does not list a DoCallback() function in its textActionsTable (Text.c). The simple fix is for you to add this function yourself. You would then specify that the RETURN key inserts and also calls back in your .XtActions file, or in an ActionsTable you pass when you create the text widget. This needs to be fixed in a future release. (I can't commit MIT to this, but I expect it will probably happen). c) I assume that the only way for the application to put text into the widget is by using XtTextReplace, if this is so and the function is public then the typedef for XtTextBlock should be in Text.h and not TextP.h? (XtTextBlock is the type of one of the arguments) Yes, it should be in Text.h. 4) Do I need to write my own forms or will they appear with the next release? A forms widget should appear in the next release (Here I go committing MIT again, though). It's port didn't make the deadline for this release. Should this type of query go straight to the toolkit people? If the answer is yes could someone tell me who the correct person to send queries to is?? This type of query is definitely appropriate here. We (toolkit group) will make every effort to respond promptly. -chuck