Title: | DECWINDOWS 26-JAN-89 to 29-NOV-90 |
Notice: | See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit |
Moderator: | STAR::VATNE |
Created: | Mon Oct 30 1989 |
Last Modified: | Mon Dec 31 1990 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3726 |
Total number of notes: | 19516 |
Has the XTranslateCoords function been changed in VMS 5.4? I have a hierarchy which looks like this : topLevel / \ dialogBox mainWindow | | simpleText window I have an event handler on the window widget and I am trying to change the coordinates of that press button event to coordinates in the dialogBox so that I can make the simpleText appear where the button was pressed. The XTranslateCoordinates gives me an access violation. I checked my arguments and they are o.k. When I use XtTranslateCoords on the two windows and calculate their offset and add this to the event->x, it looks like the window widget has a higher resolution than the dialogBox (is this possible??) because when the button is pressed close to the upper corner the stext appears in the correct position. But the farther away you get from the top corner, the more the stext appears to the right and under the button press. Dan
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
2454.1 | FontUnits? | DECWIN::KLEIN | Thu Mar 15 1990 15:43 | 6 | |
Sounds like you're using FontUnits to position the SText within its parent. Is wouldn't happen to be a dialog box, would it? If not, post some code. -steve- | |||||
2454.2 | It is a dialog box ... thanks | KAOU35::DLEROUX | Thu Mar 15 1990 16:58 | 0 | |
2454.3 | XTranslateCoordinates vs. XtTranslateCoordinates | RTL::JUNE | Fri Mar 16 1990 09:43 | 28 | |
Incidentally, you might want to get XTranslateCoordinates working. A bug (in the Shell implementation, I think) sometimes causes the Xt call to return incorrect coordinates. The most noticeable example is when the user picks up the window containing the widget whose coordinates you're getting and moves it. Subsequent calls to XtTranslateCoordinates will return values corresponding to the widget's old position, before the window was moved. Messing around with the window (i.e. iconizing and the deiconizing, etc) will fix the problem, but only until the window is moved again. The XTranslatesCoordinates call doesn't have this problem (although it is slower than the Xt call because it queries the server for position info). Here is an example of using it: int dx, dy; Display *disp = XtDisplay (toplevel); Window window; XTranslateCoordinates (disp, XtWindow(wid), DefaultRootWindow (disp), 0, 0, &dx, &dy, &window); where toplevel is my top level widget and wid is the widget whose coordinates I'm translating. The 0,0 specifies the upper left hand corner of this widget. Note that the widget must be realized, so that it has a valid window. Rich | |||||
2454.4 | I tried ... | KAOU35::DLEROUX | Fri Mar 16 1990 11:52 | 16 | |
I tried using XTranslateCoordinates with the following arguments and it gave me a access vio error. ( I'm running vms5.4-eft ) Window *window; XTranslateCoordinates( display, XtWindow( window_widg ), XtWindow( dialog_box ), 0, 0, &x, &y, window ); The only thing I can see being wrong is that it doesn't like the windows positions in the hierarchy or the function has changed in DW2.1 Dan | |||||
2454.5 | bug fix in previous | OPHION::MIKEY | Mike Yang | Fri Mar 16 1990 15:57 | 6 |
window is a return argument, so use: Window window; ..... &window ); |