home *** CD-ROM | disk | FTP | other *** search
- 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
- From: johnc@murray.bu.edu (John Collins)
- Newsgroups: comp.windows.open-look
- Subject: Problem with XV_KEY_DATA
- Message-ID: <102323@bu.edu>
- Date: 17 Nov 92 17:37:08 GMT
- Sender: news@bu.edu
- Organization: Boston University
- Lines: 32
-
- I need help.
-
- I have been writing an application with XView3. It seems that
- there is 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;
- {
- /* 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. The crash always happens
- when the routine make_canvas_ximage returns.
-
- Any help or advice would be greatly appreciated, as I have a deadline to meet.
-
- Thanks-
- John Colins
-