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

  1. Path: sparky!uunet!paladin.american.edu!europa.asd.contel.com!emory!wupost!uwm.edu!rutgers!sun-barr!news2me.EBay.Sun.COM!exodus.Eng.Sun.COM!exodus!rickg
  2. From: rickg@eng.sun.com (Richard M. Goldstein)
  3. Newsgroups: alt.toolkits.xview
  4. Subject: Re: Problems with XV_KEY_DATA
  5. Message-ID: <RICKG.92Nov17091523@irondude.eng.sun.com>
  6. Date: 17 Nov 92 14:15:23 GMT
  7. References: <102307@bu.edu>
  8. Reply-To: rickg@eng.sun.com
  9. Organization: SunSoft, Inc.
  10. Lines: 53
  11. NNTP-Posting-Host: irondude
  12. In-reply-to: johnc@murray.bu.edu's message of 17 Nov 92 16:04:04 GMT
  13.  
  14.  
  15.    From: johnc@murray.bu.edu (John Collins)
  16.    Newsgroups: alt.toolkits.xview
  17.    Date: 17 Nov 92 16:04:04 GMT
  18.    Organization: Boston University
  19.  
  20.    I have a problem with XV_KEY_DATA.  My application creates a canvas
  21.    with an XV_KEY_DATA field named CANVAS_XIMAGE_KEY.  A button callback
  22.    procedure (new_ximage()) changes the CANVAS_XIMAGE_KEY by calling a
  23.    routine called make_canvas_ximage() (which returns an XImage *).  This
  24.    is the code:
  25.  
  26.    void
  27.    new_ximage(item, event)
  28.    Panel_item item;
  29.    Event  *event;
  30.    {
  31.       Xv_xrectlist xrectlist;
  32.       Rect   *rect;
  33.       XImage *xim;
  34.  
  35.       /* First remove the old ximage key. */
  36.       xv_set(canvas, XV_KEY_DATA_REMOVE, CANVAS_XIMAGE_KEY);
  37.  
  38.       /* Get the new XImage and attach it to the canvas. */
  39.       xv_set(canvas, XV_KEY_DATA, CANVAS_XIMAGE_KEY, make_canvas_ximage() );
  40.  
  41.       /* redisplay */
  42.       ...
  43.    }
  44.  
  45.    The wierd thing about this code is that sometimes it goes off without a
  46.    hitch, and sometimes it makes the program crash.
  47.  
  48.  
  49. NULL terminating your xv_set calls may help 8^)'
  50.  
  51.  
  52. <<tank
  53. --
  54.  
  55. *********************************************************************
  56.  
  57.     Richard M. "Tank" Goldstein        rickg@Eng.Sun.COM
  58.     Window Developer Environment,
  59.     SunSoft, Inc.
  60.  
  61.     "I don't practice what I preach because I'm not the kind
  62.     of person I'm preaching to"
  63.  
  64.                 -"Bob" in Newsweek
  65.  
  66. *********************************************************************
  67.