 import spark.components.Button;
 import spark.components.supportClasses.SkinnableComponent;
 import spark.components.supportClasses.TextBase;
+import spark.events.SkinPartEvent;
 import spark.primitives.BitmapImage;
 import spark.skins.*;
 import spark.skins.spark.windowChrome.MacTitleBarSkin;

     *  This is the actual object created from the _titleIcon class
     */
    mx_internal var titleIconObject:Object;

    //--------------------------------------------------------------------------
    //
    //  Skin Parts

                                            button_mouseDownHandler);
            maximizeButton.addEventListener(MouseEvent.CLICK,
                                            maximizeButton_clickHandler);
            
            var targetWindow:DisplayObject = DisplayObject(window);
            targetWindow.addEventListener(
                NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE,
                window_displayStateChangeHandler, false, 0, true);
            
            // Add this listener so we can remove the display state change handler
            // if our window is reskinned. This fixes an RTE when the titleBar
            // display state handler ran without a window after being reskinned.
            targetWindow.addEventListener(SkinPartEvent.PART_REMOVED, partRemovedHandler,
                false, 0, true);
        }
    }

