home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bu.edu!murray!johnc
- From: johnc@murray.bu.edu (John Collins)
- Newsgroups: alt.toolkits.xview
- Subject: Problems with XV_KEY_DATA
- Keywords: XV_KEY_DATA, XImage
- Message-ID: <102307@bu.edu>
- Date: 17 Nov 92 16:04:04 GMT
- Sender: news@bu.edu
- Organization: Boston University
- Lines: 32
-
- I have a problem with XV_KEY_DATA. My application creates a canvas
- with an XV_KEY_DATA field named CANVAS_XIMAGE_KEY. A button callback
- procedure (new_ximage()) changes the CANVAS_XIMAGE_KEY by calling a
- routine called make_canvas_ximage() (which returns an XImage *). This
- is the code:
-
- void
- new_ximage(item, event)
- Panel_item item;
- Event *event;
- {
- Xv_xrectlist xrectlist;
- Rect *rect;
- XImage *xim;
-
- /* First remove the old ximage key. */
- xv_set(canvas, XV_KEY_DATA_REMOVE, CANVAS_XIMAGE_KEY);
-
- /* Get the new XImage and attach it to the canvas. */
- xv_set(canvas, XV_KEY_DATA, CANVAS_XIMAGE_KEY, make_canvas_ximage() );
-
- /* redisplay */
- ...
- }
-
- The wierd thing about this code is that sometimes it goes off without a
- hitch, and sometimes it makes the program crash.
-
- Any help or advice would be greatly appreciated, as I have a deadline to meet.
-
- Thanks-
- John Colins
-