home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / windows / openloo / 4544 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.3 KB

  1. Path: sparky!uunet!sun-barr!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!wupost!micro-heart-of-gold.mit.edu!bu.edu!murray!johnc
  2. From: johnc@murray.bu.edu (John Collins)
  3. Newsgroups: comp.windows.open-look
  4. Subject: Problem with XV_KEY_DATA
  5. Message-ID: <102323@bu.edu>
  6. Date: 17 Nov 92 17:37:08 GMT
  7. Sender: news@bu.edu
  8. Organization: Boston University
  9. Lines: 32
  10.  
  11. I need help.
  12.  
  13. I have been writing an application with XView3.  It seems that
  14. there is a problem with XV_KEY_DATA.  My application creates a canvas
  15. with an XV_KEY_DATA field named CANVAS_XIMAGE_KEY.  A button callback
  16. procedure (new_ximage()) changes the CANVAS_XIMAGE_KEY by calling a
  17. routine called make_canvas_ximage() (which returns an XImage *).  This
  18. is the code
  19.  
  20. void
  21. new_ximage(item, event)
  22. Panel_item item;
  23. Event  *event;
  24. {
  25.    /* First remove the old ximage key. */
  26.    xv_set(canvas, XV_KEY_DATA_REMOVE, CANVAS_XIMAGE_KEY);
  27.  
  28.    /* Get the new XImage and attach it to the canvas. */
  29.    xv_set(canvas, XV_KEY_DATA, CANVAS_XIMAGE_KEY, make_canvas_ximage() );
  30.  
  31.    /* redisplay */
  32.    ...
  33. }
  34.  
  35. The wierd thing about this code is that sometimes it goes off without a
  36. hitch, and sometimes it makes the program crash.  The crash always happens
  37. when the routine make_canvas_ximage returns.
  38.  
  39. Any help or advice would be greatly appreciated, as I have a deadline to meet.
  40.  
  41. Thanks-
  42. John Colins
  43.