Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!van-bc!ubc-cs!mprgate.mpr.ca!mprgate.mpr.ca!janzen From: janzen@mprgate.mpr.ca (Martin Janzen) Newsgroups: comp.windows.x.motif Subject: Re: pointers Message-ID: <1991Jun18.005310.5109@mprgate.mpr.ca> Date: 18 Jun 91 00:53:10 GMT References: <447@nic.cerf.net> Sender: news@mprgate.mpr.ca Reply-To: janzen@mprgate.mpr.ca (Martin Janzen) Organization: MPR Teltech Ltd. Lines: 39 In article <447@nic.cerf.net>, dolanmic@nic.cerf.net (Michael A. Dolan) writes: >[...] >I need to change the pointer image during the execution of a motif app. >From within a callback, I am calling the standard Xlib stuff to put >up an hourglass, using the following code: > >change_cursor( w ) >widget w; >{ > XDefineCursor( XtDisplay( w ), XtWindow( w ), > XcreateFontCursor( XtDisplay( w ), XC_gumby ) ); >} This looks like a memory leak to me; you'd probably be better off calling XCreateFontCursor only once and storing the resulting Cursor in a global variable. >and I am tearing it down with: > >unchange_cursor( w ) >{ > XUndefineCursor( XtDisplay( w ), XtWindow( w ) ); >} > >Nothing appears to happen, however. You need to let the X server know about your cursor change. In Motif, all you have to do is to call XmUpdateDisplay(w) after changing the cursor. >[...] >Please reply back at age!syd@ucsd.com if you can help. My mail bounced, so here it is. -- Martin Janzen janzen@mprgate.mpr.ca (134.87.131.13) MPR Teltech Ltd. Phone: (604) 293-5309 8999 Nelson Way Fax: (604) 293-6100 Burnaby, BC, CANADA V5A 4B5