Path: utzoo!attcan!uunet!cs.utexas.edu!usc!bloom-beacon!EXPO.LCS.MIT.EDU!converse From: converse@EXPO.LCS.MIT.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: Command Widget: changing the cursor Message-ID: <8907292241.AA19080@expo.lcs.mit.edu> Date: 29 Jul 89 22:41:29 GMT References: <1989Jul28.153846.19570@tubsibr.uucp> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 36 > How do I change the cursor of a Command (or other) Widget? In order to allow the user to override your choice of cursor, specify the cursor in an application defaults file. For example, to set all command widgets in the application class of Demo to use the gumby cursor, put this in your app defaults file: Demo*Command.cursor: gumby If you want to set the cursor in your code, you will insure that the particular cursor you chose can never be changed by a user. For an individual widget, such as a Command widget, the cursor can be set at creation time or later, using the resource XtNcursor. Here's some excerpted code as an example: #include cursor = XCreateFontCursor(XtDisplay(widget), XC_gumby); XtSetArg(args[0], XtNcursor, cursor); XtCreateManagedWidget("button", commandWidgetClass, parent, args, ONE); or, after the widget has been realized ... cursor = XCreateFontCursor(XtDisplay(widget), XC_gumby); XtSetArg(args[0], XtNcursor, cursor); XtSetValues(button, args, ONE); In case you want to set the cursor of a popup window, use the Xlib function XDefineCursor after the popup has been realized. > WidgetSet (w, XtNcursor, cursor, ...) doesn't seem to work. I don't know where this interface is defined, or what it is. Donna