Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!nsc!voder!parns!somani From: somani@parns.nsc.com (Anil Somani X14146) Newsgroups: comp.windows.x Subject: Defining cursor for a widget. Keywords: cursor XtNcursor resource Message-ID: <114@bahamas.nsc.com> Date: 25 Apr 89 18:55:06 GMT Organization: National Semiconductor, Santa Clara Lines: 71 I am trying to set the cursor for a popup widget using the XtNcursor resource, and understand that all the children of this popup will inherit this cursor by default. I have the following hierarchy in my application: -->Command | Popup--->Form---->Label1 | -->Label2 Defining XtNcursor for Popup or Form doesn't work. Defining XtNcursor explicitly for Command, Label1, Label2 works. I can never display the new cursor in the form widget even if I declare explicitly. Below is a small test program which exhibits the problem. The hierarchy for the test program is: Top->Command->Popup->Label The label widget does not get the new cursor. Any help will be appreciated. Please post or email. Thanks in advance, --------------- TEST PROGRAM -------------------------------------- #include #include #include #include #include #include #include #include static Arg args[25]; static int i=0; static XtCallbackRec callback[2]; void buttonCallback(widget,closure,calldata) Widget widget; caddr_t closure; caddr_t calldata; { static Widget popup, label; Cursor cursor; cursor=XCreateFontCursor(XtDisplay(widget),XtWindow(widget),XC_watch); i=0; XtSetArg(args[0],XtNcursor,cursor); i++; popup=XtCreatePopupShell("Popup",shellWidgetClass,widget, args,1); label=XtCreateManagedWidget("Label",labelWidgetClass,popup,NULL,0); XtPopup(popup,XtGrabNone); } main(argc,argv) int argc; char **argv; { static Widget top, button; top=XtInitialize(argv[0],"top",NULL,0,&argc,argv); callback[0].callback = buttonCallback; callback[0].closure = NULL; i=0; XtSetArg(args[0],XtNcallback,callback); i++; button=XtCreateManagedWidget("button",commandWidgetClass,top,args,i); XtRealizeWidget(top); XtMainLoop(); } -----------------------END TEST PROGRAM--------------------------------- -- Anil Somani uucp: {sun|hplabs|amdahl|decwrl}!nsc!parns!somani\n\ National Semiconductor Domain: somani@parns.nsc.com\n\ 2900 Semiconductor Dr. M/S D3-677\n\ Santa Clara, CA 95052-8090 Phone: (408)721-4146\n\