[comp.sys.amiga] Help on ModifyIDCMP

donw@beaujolais (Don White) (03/19/88)

[Why aren't dweebs green?]

    I'm having  a problem figuring out if it is possible to 
  open an IDCMP without referencing a specific window. Does
  anyone know?

  (Maybe Leo?)

                                             Thanks,
                                                donw
  {hplabs | ucbvax | oliveb | ihnp4 } ! zehntel ! donw
  BOX 271177
  Concord CA.
  94527-1177
 

kenchiu@phoenix.Princeton.EDU (Kenneth Chiu) (03/20/88)

In article <489@zehntel.UUCP> donw@beaujolais (Don White) writes:
>    I'm having  a problem figuring out if it is possible to 
>  open an IDCMP without referencing a specific window. Does
>  anyone know?

If you mean one port for several windows, you can do this by attaching your
own port before a call to OpenWindow() or ModifyIDCMP().  I don't think you
can do anything without having at least one window, but you can make it
pretty non-specific.

Ken Chiu

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (03/21/88)

In article <489@zehntel.UUCP> donw@beaujolais (Don White) writes:
>    I'm having  a problem figuring out if it is possible to 
>  open an IDCMP without referencing a specific window. Does
>  anyone know?
>
>  (Maybe Leo?)
>
	(Whyzzit always me?)

	I -- and I'm sure others -- don't understand what you're trying to
do.  What exactly is your application?  What result do you wish to achieve?

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_		Recumbent Bikes:	      dual ---> !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor

cmcmanis%pepper@Sun.COM (Chuck McManis) (03/22/88)

In article <2108@phoenix.Princeton.EDU> (Kenneth Chiu) writes:
>If you mean one port for several windows, you can do this by attaching your
>own port before a call to OpenWindow() or ModifyIDCMP().

Have you tried this? In the Intuition Manual the 'blessed' way of opening
a window without an IDCMP port is to open it with NULL IDCMP Flags, then 
copy the port to it's UserPort area and use ModifyIDCMP() to enable the
desired events. 

As for an IDCMP port standing in space, that would be just a message port.
And Intuition wouldn't send you IDCMP messages to it because it only collects
those messages from windows. If one is really looking to open a "blank" 
screen to play with but you still want messages. Then  open a full size 
borderless backdrop window and use it's IDCMP port.



--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

kenchiu@phoenix.Princeton.EDU (Kenneth Chiu) (03/22/88)

In article <46314@sun.uucp> cmcmanis@sun.UUCP (Chuck McManis) writes:
>In article <2108@phoenix.Princeton.EDU> (Kenneth Chiu) writes:
>>If you mean one port for several windows, you can do this by attaching your
>>own port before a call to OpenWindow() or ModifyIDCMP().
>Have you tried this? In the Intuition Manual the 'blessed' way of opening
>a window without an IDCMP port is to open it with NULL IDCMP Flags, then 
>copy the port to it's UserPort area and use ModifyIDCMP() to enable the
>desired events. 

I'm sorry, I didn't mean to suggest that you can attach a port to a
NewWindow structure.  I've done things exactly as they say in the manual,
and it seems to work fine.  I am a little concerned about something
that isn't quite clear, however.

How careful do you have to be about replying to all messages?  At some
point, my program will receive some kind of "close window" message
(probably from the close gadget).  Now, some amount of time will pass
between the time I get the message, and the time I actually close the window.
During that time I can get other messages from that window.

I can just assume that Intuition will properly unlink such messages, and
hope for the best.  The manual says Intuition will reclaim them, but it
isn't specific about how cleanly it does this.

Another solution is to Forbid(), search through the message list, throw
away all messages pertaining to that window, close the window, and then
Permit().

But this could deadlock if Intuition won't close the window until I
Permit(), and I won't Permit() until I return from the CloseWindow()
call, and the CloseWindow() call is blocking.

Oh well, I guess I just have to play around some and see what really
happens. . . 

Ken Chiu

shimoda@rmi.UUCP (Markus Schmidt) (03/24/88)

To Ken Chiu's Question about CloseWindow();

I for myself use this piece of code to close the window:

    Whwhile( imsg=GetMsg(Window->UserPort) ReplyMsg(imsg);
    CloseWindow(Window);

This will serve 99% of the casese. For the rest I hope Intuition will
do the right thing when closing.

|._,|   Cu
 - -    Markus
==O==   (shimoda@rmi.UUCP)
 `-'    Never trust a smiling cat!