My code is very similar to a panel tutorial... only a panel with some buttons, and some functions connected to the buttons. I've connected a function to one of the buttons that is meant to turn VISIBLE off:

main_menu.flags &= ~VISIBLE;

I've used this, and tried both toggle and reset macros, but the panel is not removed from the screen. Any pointers on what I'm missing on getting the screen to refresh when a turn panel visibility off?