Path: utzoo!attcan!uunet!know!sdd.hp.com!decwrl!adobe!asente From: asente@adobe.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: DECwindows (XUI) novice question Message-ID: <7589@adobe.UUCP> Date: 22 Oct 90 20:05:15 GMT References: <1990Oct18.180103@mccall.com> Sender: news@adobe.COM Organization: Adobe Systems Inc. Lines: 40 In article <1990Oct18.180103@mccall.com> tp@mccall.com (Terry Poot) writes: >Now the problem: the only callback in the window widget is an expose callback. >This would be fine for a static graphic display, but this is an _interactive_ >graphics application. The user can grab objects and move them, or select them >and then by hitting various keyboard keys, he does various operations on them >(for the curious, the application places pattern pieces on a printing plate). > >I have no idea how to accomplish this. What you want to do is to install some additional translations on the window widget. These translations would be for the events you want to handle and would bind to actions that you provide in your application. >Please don't _just_ tell >me what book to buy (though such hints are also appreciated), this is a small >town, and I don't have time to order it and wait for it to arrive before solving >this problem). May I suggest "X Window System Toolkit" by me and Ralph Swick; Chapter 7 is devoted to the translation mechanism. You can order it through DEC Direct; the order number is EY-E757E-DP (I have no idea how quick this might be, but since you're in a small town it's probably the easiest way). XUI is more-or-less R3 based so you should pay attention to the R3 compatibility footnotes. >Bonus question (assuming the above problem is solvable): how do I manage which >widget controls the keyboard? The first think to try is XtCallAcceptFocus; pass it the widget you want to have the focus and the time stamp from the event that made you decide to take focus (hopefully this is available to you; in XUI there's no real good way to get the time stamp otherwise). However, the window widget might not be willing to take the focus, since it doesn't expect keyboard events normally. If this is the case, you can use XSetInputFocus on the window widget's window. -paul asente New address! asente@adobe.com ...decwrl!adobe!asente