-int
-bottom_panel(PANEL *pan)
-{
- if(!pan)
- return(ERR);
- if(Is_Bottom(pan))
- return(OK);
- dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
- if(_nc_panel_is_linked(pan))
- (void)hide_panel(pan);
- panel_link_bottom(pan);
- return(OK);
+ dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
+
+ HIDE_PANEL(pan, err, OK);
+ assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+
+ dStack("<lb%d>", 1, pan);
+
+ pan->below = _nc_bottom_panel;
+ pan->above = _nc_bottom_panel->above;
+ if (pan->above)
+ pan->above->below = pan;
+ _nc_bottom_panel->above = pan;
+
+ dStack("<lb%d>", 9, pan);
+ }
+ }
+ else
+ err = ERR;
+
+ returnCode(err);