def set_icon ( self, ui ):
        from pyface.image_resource import ImageResource

        if isinstance(ui.icon, ImageResource):
            ui.control.setWindowIcon(ui.icon.create_icon())

    #---------------------------------------------------------------------------
    #  Converts a keystroke event into a corresponding key name:
    #---------------------------------------------------------------------------
Sets the icon for the UI window.
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/toolkit.py/GUIToolkit.set_icon