[comp.sys.sun] Need SunView Help

dmg@beaver.cs.washington.edu (David Geary) (12/16/88)

I've just got a couple of short questions concerning windows in SunView:

1)  How can I get a pointer to the CURRENT window?  I know how to create,
    open, and close windows, but I just want a pointer to the window my
    application starts up in.

2)  Once I get a pointer to my window, I want to be able to
    programmatically resize the window.

3)  I'd also like to draw into the window.  Do I need to add a canvas to
    the base frame of the window?  What if the window already has a canvas -
    how do I know?  Help.

I've searched through the SunView manual, and can't find the answers, so
any help, of course, would be greatly appreciated?

David Geary, Boeing Aerospace

bickel@nprdc.arpa (Steven Bickel) (12/23/88)

ssc-vax!dmg@beaver.cs.washington.edu (David Geary) writes:
>1)  How can I get a pointer to the CURRENT window?

Sounds like what you want is the old gfx subwindow stuff - before canvas'
and frames - the dark "tool" era.  Look for the old framedemo code,
flight, etc.

>2)  Once I get a pointer to my window, I want to be able to
>    programmatically resize the window.

I do not know if gfx can do this, but windowmanager calls should be able
to (?).

>3)  I'd also like to draw into the window....

Once you open the gfx it is easily written to because their is a pixwin
within every graphics window.

>I've searched through the SunView manual, and can't find the answers, so
>any help, of course, would be greatly appreciated?

You might also try the windowmanager code level stuff.  I have been able
to do some "non-supported" stuff at this level.  You might try opening a
window, retrieving its parent, retrieving the parents file descriptor, and
then resizing it.  I do not know if you will then be able to draw in it
though??

   Steve Bickel

          Steve Bickel                          bickel@nprdc.arpa
	  Systems Engineering Assoc.            (619) 553-9306
	  Naval Personel R & D Center.

ellery@trantor.harris-atd.com (Ellery Chan) (12/30/88)

I'm paraphrasing the questions from David Geary:  1) How can I get a
pointer to the window my application starts in?  2) How can I resize that
window?  3) How do I draw into that window?

I believe it is considered impolite to resize or draw in someone else's
window.  The usual approach is to have your application create its own
base frame.  That way you'll have the handle for it, you can resize it,
and you can easily create a canvas within it on which to draw.

Of course, if you really do want to manipulate the existing window you'll
probably need to poke around in the SunView System Programmer's Guide for
help.

Ellery Chan
Advanced Technology Dept.
Harris Corp., Melbourne, FL
Arpa: ellery@trantor.harris-atd.com