[comp.sys.sgi] NeWS windows and GL windows

dan@meritaus.UUCP (Daniel Haug) (02/28/90)

What is the relationship between NeWS windows and GL windows?
When I call winopen(), the resulting window looks suspiciously
similar to "framebuffer /new DefaultWindow send".  Does the
GL library create a NeWS window to coincide with the internal
GL window?  Or is it the other way around?  I've looking through
the documentation and haven't found this addressed anywhere.
Did I miss it?

If there exists a NeWS window instance that corresponds to the
GL window, how can one access it (e.g. thru CPS, but how does
one access the actual instance)?  Can I change the value of
DefaultWindow and expect subsequent winopen()'s to reflect this
change? (e.g. suppose I want my GL windows to have scroll bars,
and hence, use the ScrollWindow class).

I need to be enlightened.  Thanks...
-- 
dan haug
====================================================================
Phonenet: (512)338-2450
Internet: execu!sequoia!meritaus!dan@cs.utexas.edu
    UUCP: {uunet, cs.utexas.edu!execu, texbell}!sequoia!meritaus!dan

``When all you have is a hammer, everything begins to look like a nail.''

msc@ramoth.esd.sgi.com (Mark Callow) (03/02/90)

In article <476@meritaus.UUCP>, dan@meritaus.UUCP (Daniel Haug) writes:
> 
> What is the relationship between NeWS windows and GL windows?
> When I call winopen(), the resulting window looks suspiciously
> similar to "framebuffer /new DefaultWindow send".  Does the
> GL library create a NeWS window to coincide with the internal

The GL library does something very like

    framebuffer /new MEXWindow send

> If there exists a NeWS window instance that corresponds to the
> GL window, how can one access it (e.g. thru CPS, but how does
> one access the actual instance)?

You can access it by using the PostScript function gfsend.  The
syntax you would use in a function you cdef in a cps file is:

cdef foo(int gid)
	<message> gid gfsend

where gid is the value returned by winopen.

You have to link the resulting program with -lcps and -lbsd and don't
forget to ps_flush_PostScript() after calling your cdef'ed function.
After the next x.y release you won't need -lbsd anymore.

> Can I change the value of
> DefaultWindow and expect subsequent winopen()'s to reflect this
> change? (e.g. suppose I want my GL windows to have scroll bars,
> and hence, use the ScrollWindow class).

No.  MEXWindow is explicitly a subclass of SGIWindow because there is
a tight relationship between them.  We knew that various other
window subclasses that people might be using as "DefaultWindow" wouldn't
work for MEXWindow.  You have to change either the MEXWindow or the
SGIWindow class to affect your gl windows.
--
From the TARDIS of Mark Callow
msc@ramoth.sgi.com, ...{ames,decwrl}!sgi!msc
"There is much virtue in a window.  It is to a human being as a frame is to
a painting, as a proscenium to a play.  It strongly defines its content."