home *** CD-ROM | disk | FTP | other *** search
- 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
- From: rickg@eng.sun.com (Richard M. Goldstein)
- Newsgroups: alt.toolkits.xview
- Subject: Re: Problems with XV_KEY_DATA
- Message-ID: <RICKG.92Nov17091523@irondude.eng.sun.com>
- Date: 17 Nov 92 14:15:23 GMT
- References: <102307@bu.edu>
- Reply-To: rickg@eng.sun.com
- Organization: SunSoft, Inc.
- Lines: 53
- NNTP-Posting-Host: irondude
- In-reply-to: johnc@murray.bu.edu's message of 17 Nov 92 16:04:04 GMT
-
-
- From: johnc@murray.bu.edu (John Collins)
- Newsgroups: alt.toolkits.xview
- Date: 17 Nov 92 16:04:04 GMT
- Organization: Boston University
-
- 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.
-
-
- NULL terminating your xv_set calls may help 8^)'
-
-
- <<tank
- --
-
- *********************************************************************
-
- Richard M. "Tank" Goldstein rickg@Eng.Sun.COM
- Window Developer Environment,
- SunSoft, Inc.
-
- "I don't practice what I preach because I'm not the kind
- of person I'm preaching to"
-
- -"Bob" in Newsweek
-
- *********************************************************************
-