home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!rutgers!micro-heart-of-gold.mit.edu!bloom-beacon!INTERNET!dont-send-mail-to-path-lines
- From: converse@expo.lcs.mit.EDU (Donna Converse)
- Newsgroups: comp.windows.x
- Subject: Re: cursor in spring-loaded menu
- Message-ID: <9207232002.AA13823@excess.lcs.mit.edu>
- Date: 23 Jul 92 20:02:46 GMT
- References: <14608@umd5.umd.edu>
- Sender: daemon@athena.mit.edu (Mr Background)
- Organization: X Consortium, MIT Laboratory for Computer Science
- Lines: 56
-
-
- > I have a menu widget which I have written intended to be used as a
- > spring-loaded popup when a button is pressed (by means of an XtMenuPopup() in
- > the translations). While the menu is popped up I would like the cursor to have
- > some special shape. It seems to be hard to do this.
-
- In the Athena widget set, the SimpleMenu widget has a cursor resource.
- In this widget's realize method, the cursor for the menu is set as a
- window attribute, and this works fine.
-
- > Setting the default cursor on the widget does not do anything.
-
- I don't understand.
-
- > Nor does setting the cursor with
- > XDefineCursor() in the popup callback.
-
- This wouldn't work because the grab is already active and the pointer for
- the menu widget's window is already defined.
-
- > The cursor always seems to be that of
- > the widget that issued the grab. The XtMenuPopup action routine puts out a
- > passive pointer grab (XGrabButton). XGrabButton specifies a cursor that is
- > used during the grab. The code for this in the Intrinsics is hard for me to
- > follow but it is not obvious to me how to have cursor have any other value but
- > None.
-
- If you call XtGrabButton directly, you can specify the cursor ID through
- this interface. But this is a lot of extra work.
-
- > Perhaps I have to write my own action routine rather than XtMenuPopup()?
-
- Too much work.
-
- > Is there something I am missing? some way to get the grab to be issued with a
- > particular cursor? I have solved it with a call to XChangeActivePointerGrab()
- > in the popup callback which seems to be what the doctor ordered except that it
- > wants a new event mask to be specified. I would want to use the same event mask
- > as used in the original XGrabButton call but I have no easy way of knowing
- > that. I have used a mask for all possible pointer events.
-
- Using XChangeActivePointerGrab is okay; the actual changing of the cursor
- might be visible on slow connections, which is suboptimal. The event mask
- should be ButtonPressMask | ButtonReleaseMask which is the same as the event
- mask of the original grab.
-
- It seems to me that the menu widget should have a cursor resource, and could
- use the String to Cursor converter supplied by the Intrinsics, so that the
- cursor can be described by the application programmer and/or the user. Then
- when the widget's window is created, the supplied cursor is used for that
- window. You should be able to do this and still use XtMenuPopup; you ought
- not have to supply and register the grab action yourself.
-
-
- Donna Converse
- MIT X Consortium
-