def on_idle(self, event):
        '''prevent the main loop spinning too fast'''
        state = self.state

        if state.close_window.acquire(False):
            self.state.app.ExitMainLoop()

        # receive any display objects from the parent
        obj = None

        while not state.object_queue.empty():
            obj = state.object_queue.get()

            if isinstance(obj, SlipObject):
                self.add_object(obj)

            if isinstance(obj, SlipPosition):
                # move an object
                object = self.find_object(obj.key, obj.layer)
                if object is not None:
                    object.update_position(obj)
                    if getattr(object, 'follow', False):
                        self.follow(object)
                    state.need_redraw = True

            if isinstance(obj, SlipDefaultPopup):
                state.default_popup = obj

            if isinstance(obj, SlipInformation):
                # see if its a existing one or a new one
                if obj.key in state.info:
#                    print('update %s' % str(obj.key))
                    state.info[obj.key].update(obj)
                else:
#                    print('add %s' % str(obj.key))
                    state.info[obj.key] = obj
                state.need_redraw = True

            if isinstance(obj, SlipCenter):
                # move center
                (lat,lon) = obj.latlon
                state.panel.re_center(state.width/2, state.height/2, lat, lon)
                state.need_redraw = True

            if isinstance(obj, SlipBrightness):
                # set map brightness
                state.brightness = obj.brightness
                state.need_redraw = True

            if isinstance(obj, SlipClearLayer):
                # remove all objects from a layer
                if obj.layer in state.layers:
                    state.layers.pop(obj.layer)
                state.need_redraw = True

            if isinstance(obj, SlipRemoveObject):
                # remove an object by key
                for layer in state.layers:
                    if obj.key in state.layers[layer]:
                        state.layers[layer].pop(obj.key)
                state.need_redraw = True

            if isinstance(obj, SlipHideObject):
                # hide an object by key
                for layer in state.layers:
                    if obj.key in state.layers[layer]:
                        state.layers[layer][obj.key].set_hidden(obj.hide)
                state.need_redraw = True
        
        if obj is None:
            time.sleep(0.05)
prevent the main loop spinning too fast