def advancedselections(event=None):
    ''' Toggle advance doptions '''
    global check, checkboxes, updatebutton, clearbutton, defaultsbutton, advancedbutton, closebutton, plotfig, panelfig, results, plotargs, globaladvanced
    globaladvanced = not(globaladvanced) # Toggle
    try:    close(plotfig) # These work better here than caling closegui() directly
    except: pass
    try:    close(panelfig)
    except: pass
    check, checkboxes, updatebutton, clearbutton, defaultsbutton, advancedbutton, closebutton, plotfig, panelfig, plotargs = [None]*10 # Clear the bejesus out of everything
    pygui(results, advanced=globaladvanced)
    print('Switching to/from advanced; if GUI hangs, press enter in console') # Unfortunately, this happens from time to time
    pause(0.2) # Without this, it doesn't work...siiiigh
    return None