[comp.graphics] RETAINED canvas in SunView

jaysun@saurez.eng.clemson.edu (Jay Williamson) (09/29/89)

Does anyone have any idea why a canvas will not allow itself
to be retained?????  This is the situation:

init_bw_canvas()
{
    canvas_panel = window_create(frame, CANVAS,
            CANVAS_FAST_MONO,       TRUE,
            WIN_EVENT_PROC,         mouse_for_canvas,
            0);
    window_set(canvas_panel, WIN_CURSOR, my_cross_hairs, 0);
    window_set(canvas_panel, CANVAS_RETAINED,   FALSE,
            0);
    pw = (Pixwin *) window_get(canvas_panel, WIN_PIXWIN);
    window_set(canvas_panel, CANVAS_RETAINED,   TRUE,
            0);
}

I have tried all combinations of placing CANVAS_RETAINED attr.
but to no avail. No matter what I do the canvas will not
redraw itself if covered and then uncovered with another window.
I do not have my own repaint proc and so I have no idea why
it won't do the right thing.  Helppppppp......

Jay Williamson            Engineering Computer Operations
jaysun@eng.clemson.edu    Clemson University

Jay Williamson            Engineering Computer Operations
jaysun@eng.clemson.edu    Clemson University
|---------------------------------------------------------|

falk@sun.Eng.Sun.COM (Ed Falk) (09/30/89)

In article <6633@hubcap.clemson.edu>, jaysun@saurez.eng.clemson.edu (Jay Williamson) writes:
	:
>     pw = (Pixwin *) window_get(canvas_panel, WIN_PIXWIN);

canvases are different from other windows, you should use

      pw = (Pixwin *) window_get(canvas_panel, CANVAS_PIXWIN);

instead.  This is also defined as a macro for you:

	pw = canvas_pixwin(canvas_panel) ;


No need to play with the retained attribute at all, retained is the default.
-- 
		-ed falk, sun microsystems, sun!falk, falk@sun.com

  "If you wrapped yourself in the flag like George Bush does, you'd
  be worried about flag-burning too"