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

  1. Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bu.edu!murray!johnc
  2. From: johnc@murray.bu.edu (John Collins)
  3. Newsgroups: alt.toolkits.xview
  4. Subject: Problems with XV_KEY_DATA
  5. Keywords: XV_KEY_DATA, XImage
  6. Message-ID: <102307@bu.edu>
  7. Date: 17 Nov 92 16:04:04 GMT
  8. Sender: news@bu.edu
  9. Organization: Boston University
  10. Lines: 32
  11.  
  12. I have a problem with XV_KEY_DATA.  My application creates a canvas
  13. with an XV_KEY_DATA field named CANVAS_XIMAGE_KEY.  A button callback
  14. procedure (new_ximage()) changes the CANVAS_XIMAGE_KEY by calling a
  15. routine called make_canvas_ximage() (which returns an XImage *).  This
  16. is the code:
  17.  
  18. void
  19. new_ximage(item, event)
  20. Panel_item item;
  21. Event  *event;
  22. {
  23.    Xv_xrectlist xrectlist;
  24.    Rect   *rect;
  25.    XImage *xim;
  26.  
  27.    /* First remove the old ximage key. */
  28.    xv_set(canvas, XV_KEY_DATA_REMOVE, CANVAS_XIMAGE_KEY);
  29.  
  30.    /* Get the new XImage and attach it to the canvas. */
  31.    xv_set(canvas, XV_KEY_DATA, CANVAS_XIMAGE_KEY, make_canvas_ximage() );
  32.  
  33.    /* redisplay */
  34.    ...
  35. }
  36.  
  37. The wierd thing about this code is that sometimes it goes off without a
  38. hitch, and sometimes it makes the program crash.
  39.  
  40. Any help or advice would be greatly appreciated, as I have a deadline to meet.
  41.  
  42. Thanks-
  43. John Colins
  44.