#
CwMoveObjectToBack

### Syntax:

    call CwMoveObjectToBack hObject

            hObject         (handle) The handle referencing an object

### Description:

This procedure moves the given object "hObject" to the back (i.e. behind all other objects in the current view.)

### Example:

    /* Sort all objects by width (widest to the back) using a modified
       insertion sort. */
    vh = CwGetCurrentView()
    num = CwGetObjectCount()
    do nsorted = 0 to num - 1

            obj.1 = CwFindPreviousObject(0)
            do i = 2 to num
                    ndx = i - 1
                    obj.i = CwFindPreviousObject(obj.ndx)
                    end

            smallest=1000000000000000000000000
            do i=nsorted + 1 to num

                    w1 = CwGetProperty(obj.i, "Position:width")
                    if w1 < smallest then do
                            smallest = w1
                            smallestobj = i
                            end
                    end
            call CwMoveObjectToBack obj.smallestobj
            call CwWaitOnRender vh
            end

### Remarks:

This procedure will interfere with the object-searching functions CwFindFirstObject, CwFindLastObject, CwFindNextObject, CwFindPreviousObject, CwFindDeeperObject and CwFindShallowerObject. Moving an object while listing objects with CwGet{First,Next}Object will yield unpredictable results. In the case of the CwFind functions, search order is guaranteed and based on the previous given object, so it is possible to predict whether or not they will behave as expected. Not that it won't be a little confusing to do so.

Functions by NAME | Index | Functions by PURPOSE