Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!EXPO.LCS.MIT.EDU!converse From: converse@EXPO.LCS.MIT.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: Defining cursor for a widget. Message-ID: <8904261524.AA20359@expo.lcs.mit.edu> Date: 26 Apr 89 15:24:50 GMT References: <114@bahamas.nsc.com> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 32 To define a cursor effective for the entire popup widget and all of its children, you must use XDefineCursor() after the widget has been realized. In this case, you do not set the cursor for the individual children of the popup widget, or on the popup widget itself, at the time of widget creation. XDefineCursor takes an argument indicating which cursor to use. There are two ways to get this argument: 1. You may `hard code' the choice of cursor with an Xlib call, such as XCreateFontCursor(dpy, XC_gumby) 2. If the application programmer wants to allow the user to set his/her own cursor, then the cursor can be specified in an application defaults file, and in that case, the name of the cursor does not include the leading XC_ and the toolkit will call XCreateFontCursor() for you. The example code will work if the button callback is changed to: { static Widget popup, label; Cursor cursor; cursor=XCreateFontCursor(XtDisplay(widget),XC_watch); popup=XtCreatePopupShell("Popup",shellWidgetClass,widget,NULL,0); label=XtCreateManagedWidget("Label",labelWidgetClass,popup,NULL,0); XtPopup(popup,XtGrabNone); XDefineCursor(XtDisplay(popup), XtWindow(popup), cursor); } The original example code had an extra argument to XCreateFontCursor()