def METHOD_NAME(callback, event=None):
    '''
    Connect to the application wide "gui events" which has
    a callback syntax:
        callback(event,einfo)
    Optionally specify an event name to only recieve events
    of the specified type.
    '''
    global qapp
    if event is None:
        qapp.guievents.disconnect( callback )
        return
    chan = qapp.vqtchans.get(event)
    if chan is not None:
        chan.guievents.disconnect(callback)