[comp.sys.amiga.tech] Finding Screens

tron1@tronsbox.xei.com (HIM) (09/17/90)

Ok.. first off , to all who responded RE C/C++ for me I appreciate it , I am
going to use C for the time being and will convert when the C++ 2.01 comes
out.

Now , my application will be built in stages , there will be a main program
that handles most of the GUI stuff, and synchronization for the component
peices.

But I would like most of it to be in the form of expandable modules so I
need to write a program that will...

     1) Find the screen of the master program.

     2) Open a window on that screen.

I will use message ports to have the client tell the master that there is a
window there to avoid confusion, but inso far as FINDING the screen goes...

Should I have the client wak the Screen structure list starting at the
workbench screen ? (I assume this will break in 2.0) or should it get the
pointer as a message from the host ????

========[ Xanadu Enterprises Inc. Amiga & Unix Software Development]========
=      "And in the darkened offices, the terminals shine like stars."      =
============= Ken Jamieson: uunet!tronsbox.xei.com!tron1  ==================
= NONE of the opinions represented here are endorsed by either             =
= Xanadu Enterpises or its clients, AT&T Bell Labs or others.              =
==== The Romantic Encounters BBS 201-759-8450(PEP) / 201-759-8568(2400) ==== 

peter@cbmvax.commodore.com (Peter Cherna) (09/17/90)

In article <26f437ee-918comp.sys.amiga.tech@tronsbox.xei.com> tron1@tronsbox.xei.com (HIM) writes:
>
>
>But I would like most of it to be in the form of expandable modules so I
>need to write a program that will...
>
>     1) Find the screen of the master program.
>
>     2) Open a window on that screen.
>
>I will use message ports to have the client tell the master that there is a
>window there to avoid confusion, but inso far as FINDING the screen goes...
>
>Should I have the client wak the Screen structure list starting at the
>workbench screen ? (I assume this will break in 2.0) or should it get the
>pointer as a message from the host ????

No.  Do not walk the screen structure.  Two cooperating programs should
anyways have a method of talking to each other about application specific
things, so make this just another piece of information.  It seems to
me that initial rendezvous between two cooperating things should be
done by finding a "named" object.  The most appropriate would be a
named message port.  (Named libraries are another example that is
less applicable to you).  Under 2.0, we have named screens as well.

>============= Ken Jamieson: uunet!tronsbox.xei.com!tron1  ==================

     Peter
--
     Peter Cherna, Software Engineer, Commodore-Amiga, Inc.
     {uunet|rutgers}!cbmvax!peter    peter@cbmvax.cbm.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"Very strange... the window is broken on both sides."

tron1@tronsbox.xei.com (HIM) (09/18/90)

>Resp: 1 of 1 About: Re: Finding Screens
><> [Peter Cherna] (*Masked*@cbmvax.commodore.com)
>
>No.  Do not walk the screen structure.  Two cooperating programs should
>anyways have a method of talking to each other about application specific
>things, so make this just another piece of information.  It seems to
>me that initial rendezvous between two cooperating things should be
>done by finding a "named" object.  The most appropriate would be a
>named message port.  (Named libraries are another example that is
>less applicable to you).  Under 2.0, we have named screens as well.
>

Thanks! I have decided to d this because it "seemed" cleaner , but a few
nice folks did also remind me that IntuitionBase has a screen pointer in it
as well.

Thanks for all the help ...

========[ Xanadu Enterprises Inc. Amiga & Unix Software Development]========
=      "And in the darkened offices, the terminals shine like stars."      =
============= Ken Jamieson: uunet!tronsbox.xei.com!tron1  ==================
= NONE of the opinions represented here are endorsed by either             =
= Xanadu Enterpises or its clients, AT&T Bell Labs or others.              =
==== The Romantic Encounters BBS 201-759-8450(PEP) / 201-759-8568(2400) ==== 

brianm (Brian Moffet) (09/18/90)

tron1@tronsbox.xei.com (HIM) writes:

>I will use message ports to have the client tell the master that there is a
>window there to avoid confusion, but inso far as FINDING the screen goes...

>Should I have the client wak the Screen structure list starting at the
>workbench screen ? (I assume this will break in 2.0) or should it get the
>pointer as a message from the host ????

Why don't you have the screen memory as part of the message port
structure? 

I am not absolutely positive this would work, but I would imagine that
you could allocate the screen via OpenScreen( &NewScreen ), and copy
the resulting Screen structure into you Message Port Structure.
Your pointers to all the relevent data would be there, which might cause
a problem if you get into an MMU equipped amiga (whose OS knows about it).

Well, perhaps not, but I would not walk through the list.  I would make
the screen info part of the message port, either via pointer in the 
message port, or have the screen as part of the message port.  I am not
sure which is more "proper" as far as kindness to the OS is concerned.
(ie more portable)

brian moffet