fix function to take the hook param
[AROS.git] / workbench / libs / datatypes / removedtobject.c
blobaef5f174a0605fff00d443f4303c58ac2ac90b4a
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #define USE_BOOPSI_STUBS
10 #include <intuition/intuition.h>
11 #include <intuition/classusr.h>
12 #include <datatypes/datatypesclass.h>
13 #include <clib/boopsistubs.h>
14 #include <proto/dos.h>
15 #include <proto/intuition.h>
16 #include "datatypes_intern.h"
19 /*****************************************************************************
21 NAME */
22 #include <proto/datatypes.h>
24 AROS_LH2(LONG, RemoveDTObject,
26 /* SYNOPSIS */
27 AROS_LHA(struct Window *, window, A0),
28 AROS_LHA(Object *, object, A1),
30 /* LOCATION */
31 struct Library *, DataTypesBase, 16, DataTypes)
33 /* FUNCTION
35 Remove an object from the specified window's object list; this will wait
36 until the AsyncLayout process is ready. The object will receive a message
37 of type DTM_REMOVEDTOBJECT as a sign of it having been removed.
39 INPUTS
41 window -- pointer to the window in question
42 object -- pointer to the object to remove
44 RESULT
46 The position of the object in the list before it was removed; if the
47 object wasn't found -1 is returned.
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
57 AddDTObject(), intuition.library/RemoveGList()
59 INTERNALS
61 HISTORY
63 *****************************************************************************/
65 AROS_LIBFUNC_INIT
67 LONG retval = 0;
69 if(object != NULL)
71 struct DTSpecialInfo *dtsi = ((struct Gadget *)object)->SpecialInfo;
73 while(dtsi->si_Flags & DTSIF_LAYOUTPROC)
75 Delay(50);
78 retval = RemoveGList(window, (struct Gadget *)object, 1);
80 DoMethod(object, DTM_REMOVEDTOBJECT, 0);
83 return retval;
85 AROS_LIBFUNC_EXIT
86 } /* RemoveDTObject */