T.R | Title | User | Personal Name | Date | Lines |
---|
2539.1 | Unrealized widget == PointerWindow (!) | DECWIN::KLEIN | | Wed Mar 28 1990 18:28 | 11 |
| How are you getting the "grandfather" widget? Check whether you're
getting back a zero for the window ID. I suspect that you are passing
a zero, which means "PointerWindow".
Thus, if you are passing a zero window ID, then the event goes to whichever
window contains the pointer.
This will happen if the widget you're fetching the window ID from has not
been realized.
-steve-
|
2539.2 | No zero window-ID! | STKHLM::BERGGREN | Nils Berggren SWAS/Telecom,Sweden | Thu Mar 29 1990 03:44 | 16 |
| Re: .1
>>> How are you getting the "grandfather" widget? Check whether you're
>>> getting back a zero for the window ID. I suspect that you are
>>> passing a zero, which means "PointerWindow".
The grandfather widget is got by
grandfather = XtParent( XtParent(ThisWidget) )
and the window ID is got by
XtWindow( grandfather )
When run under the debugger I have checked that grandfather points
correctly to the grandfather widget and XtWindow doesn't return zero..
Any other clues?
/Nils
|
2539.3 | worth a try... | NRMACP::WATSON | Because Daddy says so...thats why | Fri Mar 30 1990 05:55 | 10 |
| I too have had lots of problems with XSendEvent - see note 809 in the X
notes file. In particular, I can't get PointerWindow or FocusWindow to
work at all. The only way I have got XSendEvent to work is by
explicitly changing the "window" field of the event structure you are
passing as well as passing the window argument.
Jim Gettys has also suggested I try things out on a R4 server, but I don't
have one available.
-- Rob
|
2539.4 | Working example fragment | DECWIN::KLEIN | | Fri Mar 30 1990 12:52 | 16 |
| Just in case it helps, here is an example of XSendEvent that definitely
does work:
-steve-
------------------------------------------------------------------------------
XEvent event; /* allocate full event buffer */
event.xclient.type = ClientMessage;
event.xclient.display = XtDisplay (w);
event.xclient.window = XtWindow (w);
event.xclient.message_type = 0;
event.xclient.format = 32;
XSendEvent (XtDisplay (w), XtWindow (w), 0, 0, &event);
|
2539.5 | What out for those addresses! | WILLET::freb | Karl Freburger Object-based Systems | Fri Mar 30 1990 14:19 | 20 |
| Re: .0:
I notice that your XSendEvent call looks like:
XSendEvent(XtDisplay(w),
Xtwindow( grandfather ),
FALSE,
KeyPressMask,
event);
If event is decalred as
XEvent event;
then you probably should be passing &event. As I recall, ancient C compilers
will treat event and &event the same, but newer ones can pass structs as
arguments, and event and &event are very different. Then again, maybe
I'm just out in left field as usual...
- karl
|
2539.6 | works when changing the "window"-field | STKHLM::BERGGREN | Nils Berggren SWAS/Telecom,Sweden | Mon Apr 02 1990 08:08 | 9 |
| Re .3
I got it to work by explicitly changing the "window" field of the event
structure event though I don't think this is the correct wy to do
it....
Thanks!
/Nils
|
2539.7 | re .5: event declared as a pointer | STKHLM::BERGGREN | Nils Berggren SWAS/Telecom,Sweden | Mon Apr 02 1990 08:12 | 8 |
| Re .5
I have declared event as a pointer to XEvent, i.e. XEvent *event;
so that shouldn't be the problem I think.
Thanks any way,
/Nils
|
2539.8 | Server bug? | NRMACP::WATSON | Because Daddy says so...thats why | Tue Apr 03 1990 14:01 | 6 |
| RE .6
Glad that worked. I reckon this may be a server bug, and have SPRed
it. Could someone try this on an R4 server to check ?
-- Rob
|