[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

1496.0. "IDCMP and window questions" by VIDEO::LEIBOW (Michael Leibow) Wed Jun 22 1988 19:24

    
    I have a program which needs to open many windows.  I would like
    to use the IDCMP to talk with intuition.  Would the following
    pseudo-code work?
    
    GetMeAWindow( garbage, ... )
    {
    	...
    	if ( first_window )
    		new_window_stuff->IDCMPFlags = MyIDCMPFlags;
    	else
    		new_window_stuff->IDCMPFlags = 0;
        some_struct[n].window = OpenWindow( new_window_stuff );
        if ( first_window ) {
    		MasterPort = some_struct[n].window->UserPort;
    		some_struct[n].window->UserPort = NULL;
        } else {
    		ModifyIDCMP( ... , MyIDCMPFlags, ..., MasterPort)
        }
    }
    
    KillAWindow( garbage, ... )
    {
    	...
    	CloseWindow( some_struct[n].window );
    	if ( that was the last window ) {
    		DeletePort( MasterPort );
    		MasterPort = NULL;
    	}
    }
    
    
    Is the DeletePort enough to tell intuition I don't need it anymore?
    Will the ModifyIDCMP attach a window to a port?
    Is it OK to remove the IDCMP port from the window structure and
    use it reguardless of whether the original window exists or not?
    
    	Thanks for your help,
    
    	--Mike
    
    
T.RTitleUserPersonal
Name
DateLines